New background property: <animal_friend> will refuse to attack animals, unless attacked by that animal.

New background property: <civgroup_loyal> will refuse to attack neutral members of the same civilian group.
Fixed array bound in GetTileSetIndexVector().

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8731 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-01-15 20:27:00 +00:00
parent 9c563c9c8a
commit cbc1b8c5e3
13 changed files with 104 additions and 41 deletions
+13 -2
View File
@@ -148,8 +148,9 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha
strcmp(name, "traplevel") == 0 ||
strcmp(name, "no_male") == 0 ||
strcmp(name, "no_female") == 0 ||
strcmp(name, "loyalitylossondeath" ) == 0 ))
strcmp(name, "loyalitylossondeath" ) == 0 ||
strcmp(name, "animal_friend") == 0 ||
strcmp(name, "civgroup_loyal") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
@@ -654,6 +655,16 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curBackground.uiFlags |= (UINT16)atol( pData->szCharData ) ? BACKGROUND_GLOBALOYALITYLOSSONDEATH : 0;
}
else if (strcmp(name, "animal_friend") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.uiFlags |= (UINT16)atol(pData->szCharData) ? BACKGROUND_ANIMALFRIEND : 0;
}
else if (strcmp(name, "civgroup_loyal") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.uiFlags |= (UINT16)atol(pData->szCharData) ? BACKGROUND_CIVGROUPLOYAL : 0;
}
pData->maxReadDepth--;
}