From: Andy D. <kha...@us...> - 2005-01-01 22:06:00
|
Update of /cvsroot/planeshift/planeshift/src/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8987/client Modified Files: modehandler.cpp Log Message: Changed psCombatEventMessage to send anim common_string IDs instead of the direct anim id from the cal3d file to prevent anim differences between the server and client. Index: modehandler.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/modehandler.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** modehandler.cpp 27 Dec 2004 18:38:35 -0000 1.89 --- modehandler.cpp 1 Jan 2005 22:05:46 -0000 1.90 *************** *** 61,64 **** --- 61,65 ---- #include "util/log.h" #include "util/slots.h" + #include "psclientdr.h" #include "paws/pawsmanager.h" *************** *** 951,956 **** // Set the relevant anims ! if (event.attack_anim != -1) { csRef<iSpriteCal3DState> state(SCF_QUERY_INTERFACE(atObject->pcmesh->GetMesh()->GetMeshObject(), iSpriteCal3DState) ); --- 952,959 ---- // Set the relevant anims ! if (event.attack_anim != csInvalidStringID) { + csString animName = psengine->GetCelClient()->GetClientDR()->GetMsgStrings()->Request(event.attack_anim); + csRef<iSpriteCal3DState> state(SCF_QUERY_INTERFACE(atObject->pcmesh->GetMesh()->GetMeshObject(), iSpriteCal3DState) ); *************** *** 958,966 **** { printf("Attacker %s anim %d\n",atObject->GetName() ,event.attack_anim); ! state->SetAnimAction(event.attack_anim,0.5F,0.5F); } } ! if (event.defense_anim != -1) { csRef<iSpriteCal3DState> state(SCF_QUERY_INTERFACE(tarObject->pcmesh->GetMesh()->GetMeshObject(), iSpriteCal3DState) ); --- 961,971 ---- { printf("Attacker %s anim %d\n",atObject->GetName() ,event.attack_anim); ! state->SetAnimAction(animName,0.5F,0.5F); } } ! if (event.defense_anim != csInvalidStringID) { + csString animName = psengine->GetCelClient()->GetClientDR()->GetMsgStrings()->Request(event.defense_anim); + csRef<iSpriteCal3DState> state(SCF_QUERY_INTERFACE(tarObject->pcmesh->GetMesh()->GetMeshObject(), iSpriteCal3DState) ); *************** *** 973,982 **** state->SetVelocity(0); state->ClearAllAnims(); ! state->SetAnimAction(event.defense_anim,0.0F,1.0F); } else { printf("Got anim %d for defense.\n",event.defense_anim); ! state->SetAnimAction(event.defense_anim,0.5F,0.5F); } } --- 978,987 ---- state->SetVelocity(0); state->ClearAllAnims(); ! state->SetAnimAction(animName,0.0F,1.0F); } else { printf("Got anim %d for defense.\n",event.defense_anim); ! state->SetAnimAction(animName,0.5F,0.5F); } } |