mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 11:40:44 +00:00
Carry over team flag fix from nblood
This commit is contained in:
parent
049665e03e
commit
2b44f8e79d
1 changed files with 44 additions and 8 deletions
|
@ -978,20 +978,56 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
|
|||
}
|
||||
}
|
||||
return 0;
|
||||
case kItemFlagA:
|
||||
case kItemFlagA: {
|
||||
if (gGameOptions.nGameType != 3) return 0;
|
||||
evKill(pItem->index, 3, kCallbackReturnFlag);
|
||||
pPlayer->hasFlag |= 1;
|
||||
pPlayer->used2[0] = pItem->index;
|
||||
gBlueFlagDropped = false;
|
||||
const bool enemyTeam = (pPlayer->teamId&1) == 1;
|
||||
if (!enemyTeam && (pItem->owner >= 0) && (pItem->owner < kMaxSprites)) {
|
||||
pPlayer->hasFlag &= ~1;
|
||||
pPlayer->used2[0] = -1;
|
||||
spritetype* pOwner = &sprite[pItem->owner];
|
||||
XSPRITE* pXOwner = &xsprite[pOwner->extra];
|
||||
trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
|
||||
sprintf(buffer, "%s returned Blue Flag", gProfile[pPlayer->nPlayer].name);
|
||||
sndStartSample(8003, 255, 2, 0);
|
||||
viewSetMessage(buffer);
|
||||
break;
|
||||
}
|
||||
pPlayer->hasFlag |= 1;
|
||||
pPlayer->used2[0] = pItem->owner;
|
||||
if (enemyTeam)
|
||||
{
|
||||
sprintf(buffer, "%s stole Blue Flag", gProfile[pPlayer->nPlayer].name);
|
||||
sndStartSample(8007, 255, 2, 0);
|
||||
viewSetMessage(buffer);
|
||||
}
|
||||
break;
|
||||
case kItemFlagB:
|
||||
}
|
||||
case kItemFlagB: {
|
||||
if (gGameOptions.nGameType != 3) return 0;
|
||||
evKill(pItem->index, 3, kCallbackReturnFlag);
|
||||
pPlayer->hasFlag |= 2;
|
||||
pPlayer->used2[1] = pItem->index;
|
||||
gRedFlagDropped = false;
|
||||
const bool enemyTeam = (pPlayer->teamId&1) == 0;
|
||||
if (!enemyTeam && (pItem->owner >= 0) && (pItem->owner < kMaxSprites)) {
|
||||
pPlayer->hasFlag &= ~2;
|
||||
pPlayer->used2[1] = -1;
|
||||
spritetype* pOwner = &sprite[pItem->owner];
|
||||
XSPRITE* pXOwner = &xsprite[pOwner->extra];
|
||||
trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
|
||||
sprintf(buffer, "%s returned Red Flag", gProfile[pPlayer->nPlayer].name);
|
||||
sndStartSample(8002, 255, 2, 0);
|
||||
viewSetMessage(buffer);
|
||||
break;
|
||||
}
|
||||
pPlayer->hasFlag |= 2;
|
||||
pPlayer->used2[1] = pItem->owner;
|
||||
if (enemyTeam)
|
||||
{
|
||||
sprintf(buffer, "%s stole Red Flag", gProfile[pPlayer->nPlayer].name);
|
||||
sndStartSample(8006, 255, 2, 0);
|
||||
viewSetMessage(buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kItemArmorBasic:
|
||||
case kItemArmorBody:
|
||||
case kItemArmorFire:
|
||||
|
|
Loading…
Reference in a new issue