Aivolution:

Fixed a script function calling getPlayerName(-1) and causing an assert.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4335 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2008-03-25 21:22:56 +00:00
parent 38cfafe7b8
commit 2e66547554
1 changed files with 14 additions and 3 deletions

View File

@ -200,6 +200,9 @@
#define TAUNT_SUCCESS 0 #define TAUNT_SUCCESS 0
#define TAUNT_FAILURE 1 #define TAUNT_FAILURE 1
#define NONE (-1)
public int player,numLego,numTemplates[2],numBaseStructs,numDef,numRes[2], public int player,numLego,numTemplates[2],numBaseStructs,numDef,numRes[2],
numGatewayDef,numAA,numRepairTmpl,maxDamageLevels,damageLevel[4], numGatewayDef,numAA,numRepairTmpl,maxDamageLevels,damageLevel[4],
numBranches,techTanks,techAir,numVtolTemplates,numVitalStructs, numBranches,techTanks,techAir,numVtolTemplates,numVitalStructs,
@ -10432,7 +10435,7 @@ function void checkBaseThreat()
_counterEnemy = counterEnemy; _counterEnemy = counterEnemy;
stopDefending(); stopDefending();
taunt(enemy, TAUNT_SUCCESS, 55); taunt(NONE, TAUNT_SUCCESS, 55);
notifyAllies("i'm ok", FALSE); //tell allies we are ok now notifyAllies("i'm ok", FALSE); //tell allies we are ok now
@ -10607,18 +10610,26 @@ function void notifyIdle(bool bAfterFailure)
function void taunt(int targetPlayer, int type, int tauntProbability) function void taunt(int targetPlayer, int type, int tauntProbability)
{ {
local string sTargetName;
if(random(100) >= tauntProbability) if(random(100) >= tauntProbability)
{ {
return; return;
} }
// see if we are refering to some player
if(targetPlayer != NONE)
{
sTargetName = getPlayerName(targetPlayer) & ", ";
}
dice = random(10); dice = random(10);
if(type == TAUNT_SUCCESS) if(type == TAUNT_SUCCESS)
{ {
if(dice < 3) if(dice < 3)
{ {
notifyAll(getPlayerName(targetPlayer) & ", you suck."); notifyAll(sTargetName & "you suck.");
} }
else if(dice < 7) else if(dice < 7)
{ {
@ -10631,7 +10642,7 @@ function void taunt(int targetPlayer, int type, int tauntProbability)
} }
else if(type == TAUNT_FAILURE) else if(type == TAUNT_FAILURE)
{ {
notifyAll(getPlayerName(targetPlayer) & ", screw you!!"); notifyAll(sTargetName & "screw you!!");
} }
} }