- Bugfix: Multiplayer: Fixed crash when trowing items (by Realist)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4610 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-08-14 09:22:21 +00:00
parent 1a2c89eea1
commit 068c67c78c
+19
View File
@@ -2829,7 +2829,26 @@ void recieveGRENADE (RPCParameters *rpcParameters)
// Do grenade animation (todo fix this for mortars)
if (gren->IsThrownGrenade)
{
{
Assert(pThrower->pThrowParams == NULL);
// not a mem leak
// will be freed in AdjustToNextAnimationFrame(SOLDIERTYPE*), case 461
pThrower->pThrowParams = (THROW_PARAMS*) malloc(sizeof(THROW_PARAMS));
pThrower->pThrowParams->dForceX = gren->dForceX;
pThrower->pThrowParams->dForceY = gren->dForceY;
pThrower->pThrowParams->dForceZ = gren->dForceZ;
pThrower->pThrowParams->dLifeSpan = gren->dLifeSpan;
pThrower->pThrowParams->dX = gren->dX;
pThrower->pThrowParams->dY = gren->dY;
pThrower->pThrowParams->dZ = gren->dZ;
pThrower->pThrowParams->ubActionCode = gren->ubActionCode;
pThrower->pThrowParams->uiActionData = gren->uiActionData;
}
HandleSoldierThrowItem( pThrower, gren->sTargetGridNo );
}
}
}
else