mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
New tag <shotAnimation> in AmmoTypes.xml allows defining custom shot animation.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8800 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -87,7 +87,8 @@ ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char
|
||||
strcmp(name, "dDamageModifierTank" ) == 0 ||
|
||||
strcmp(name, "dDamageModifierArmouredVehicle" ) == 0 ||
|
||||
strcmp(name, "dDamageModifierCivilianVehicle" ) == 0 ||
|
||||
strcmp(name, "dDamageModifierZombie") == 0 ))
|
||||
strcmp(name, "dDamageModifierZombie") == 0 ||
|
||||
strcmp(name, "shotAnimation") == 0))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
@@ -340,6 +341,11 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
|
||||
// reasonable values only
|
||||
pData->curAmmoType.dDamageModifierZombie = min( 100.0f, max( 0.0f, pData->curAmmoType.dDamageModifierZombie ) );
|
||||
}
|
||||
else if (strcmp(name, "shotAnimation") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
strncpy(pData->curAmmoType.shotAnimation, pData->szCharData, MAX_ANIMATION_FILENAME_LEN);
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
@@ -348,8 +354,6 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BOOLEAN ReadInAmmoTypeStats(STR fileName)
|
||||
{
|
||||
HWFILE hFile;
|
||||
@@ -464,6 +468,7 @@ BOOLEAN WriteAmmoTypeStats()
|
||||
FilePrintf(hFile,"\t\t<dDamageModifierArmouredVehicle>%4.2f</dDamageModifierArmouredVehicle>\r\n", AmmoTypes[cnt].dDamageModifierArmouredVehicle );
|
||||
FilePrintf(hFile,"\t\t<dDamageModifierCivilianVehicle>%4.2f</dDamageModifierCivilianVehicle>\r\n", AmmoTypes[cnt].dDamageModifierCivilianVehicle );
|
||||
FilePrintf(hFile,"\t\t<dDamageModifierZombie>%4.2f</dDamageModifierZombie>\r\n", AmmoTypes[cnt].dDamageModifierZombie );
|
||||
FilePrintf(hFile, "\t\t<shotAnimation>%s</shotAnimation>\r\n", AmmoTypes[cnt].shotAnimation);
|
||||
|
||||
FilePrintf(hFile,"\t</AMMOTYPE>\r\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user