Align AVA2 Windows behavior and improve mobile touch interactions
This commit is contained in:
@@ -127,18 +127,31 @@ bool RaceData::LoadRaceData(const std::string& fileName) {
|
||||
}
|
||||
loader.setParent();
|
||||
}
|
||||
// AttachingData: only COLLISION_TYPE_DEFENDING sphere radii are kept (CActorInstance defending
|
||||
// spheres, approximated by one cylinder for the attack hit test). Attached effects are not ported.
|
||||
// Keep DEFENDING positions for skill range checks; normal attacks still use the
|
||||
// largest-radius cylinder. Attached effects remain separate.
|
||||
m_defendingSpheres.clear();m_bodySpheres.clear();
|
||||
m_defendingRadius=0;
|
||||
if (loader.setChildNode("attachingdata")) {
|
||||
for (size_t i = 0; i < loader.childCount(); ++i) {
|
||||
if (!loader.setChild(i)) continue;
|
||||
int collisionType = 0;
|
||||
if (loader.tokenInteger("collisiontype", &collisionType) && collisionType == 3) {
|
||||
if (loader.tokenInteger("collisiontype", &collisionType) && (collisionType == 3 || collisionType == 1)) {
|
||||
int attached=0;std::string bone;
|
||||
loader.tokenInteger("isattaching", &attached);
|
||||
loader.tokenString("attachingbonename", &bone);
|
||||
for (size_t j = 0; j < loader.childCount(); ++j) {
|
||||
if (!loader.setChild(j)) continue;
|
||||
std::string radius;
|
||||
if (loader.tokenString("radius", &radius))
|
||||
m_defendingRadius = std::max(m_defendingRadius, float(std::atof(radius.c_str())));
|
||||
if (loader.tokenString("radius", &radius)) {
|
||||
DefendingSphere sphere;sphere.radius=float(std::atof(radius.c_str()));
|
||||
sphere.attached=attached!=0;sphere.bone=bone;
|
||||
const auto* position=loader.tokenVector("position");
|
||||
if(position && position->size()==3) {
|
||||
for(int k=0;k<3;++k)sphere.position[k]=float(std::atof((*position)[k].c_str()));
|
||||
(collisionType==3?m_defendingSpheres:m_bodySpheres).push_back(sphere);
|
||||
}
|
||||
if(collisionType==3)m_defendingRadius=std::max(m_defendingRadius,sphere.radius);
|
||||
}
|
||||
loader.setParent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user