mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
- Bugfix: The name-tag in Drugs.xml made the drug system not working (by Flugente)
- New drug effect: cyanide damages life as a sideeffect. Currently doesn't kill, but lets you lose consciousness. (by Flugente) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5263 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -48,6 +48,7 @@ drugsStartElementHandle(void *userData, const XML_Char *name, const XML_Char **a
|
||||
}
|
||||
else if(pData->curElement == ELEMENT &&
|
||||
(strcmp(name, "ubType") == 0 ||
|
||||
strcmp(name, "name") == 0 ||
|
||||
strcmp(name, "ubDrugTravelRate") == 0 ||
|
||||
strcmp(name, "ubDrugWearoffRate") == 0 ||
|
||||
strcmp(name, "ubDrugEffect") == 0 ||
|
||||
@@ -95,7 +96,8 @@ drugsEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
if(pData->curDrugs.ubType < pData->maxArraySize && pData->curDrugs.ubType > 0) // do not write the first item into our array
|
||||
// we do NOT want to read the first entry -> move stuff by 1
|
||||
if(pData->curDrugs.ubType < pData->maxArraySize + 1 && pData->curDrugs.ubType > 0) // do not write the first item into our array
|
||||
{
|
||||
pData->curArray[pData->curDrugs.ubType - 1] = pData->curDrugs; //write the drugs into the table
|
||||
}
|
||||
@@ -105,6 +107,11 @@ drugsEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curDrugs.ubType = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "name") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
// not needed, but its there :-(
|
||||
}
|
||||
else if(strcmp(name, "ubDrugTravelRate") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
Reference in New Issue
Block a user