diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index db14951ee..2c26951b4 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -3235,7 +3235,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType, gPlayer[p].fraggerId = -1; } if (pSprite->type != kDudeCultistBeast) - trTriggerSprite(pSprite->index, pXSprite, kCmdOff, nKillerSprite); + trTriggerSprite(pSprite->index, pXSprite, kCmdOff); pSprite->flags |= 7; if (VanillaMode()) { @@ -3747,7 +3747,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in break; } - trTriggerSprite(pSprite->index, pXSprite, kCmdOff, nSource); + trTriggerSprite(pSprite->index, pXSprite, kCmdOff); switch (pSprite->type) { case kThingObjectGib: @@ -4501,7 +4501,7 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite) if (spriRangeIsFine(nHSprite) && xspriRangeIsFine(sprite[nHSprite].extra)) { XSPRITE* pXHSprite = &xsprite[sprite[nHSprite].extra]; if (pXHSprite->Touch && !pXHSprite->isTriggered && (!pXHSprite->DudeLockout || IsPlayerSprite(pSprite))) - trTriggerSprite(nHSprite, pXHSprite, kCmdSpriteTouch, nSprite); + trTriggerSprite(nHSprite, pXHSprite, kCmdSpriteTouch); } // Touch walls @@ -4511,7 +4511,7 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite) if (wallRangeIsFine(nHWall) && xwallRangeIsFine(wall[nHWall].extra)) { XWALL* pXHWall = &xwall[wall[nHWall].extra]; if (pXHWall->triggerTouch && !pXHWall->isTriggered && (!pXHWall->dudeLockout || IsPlayerSprite(pSprite))) - trTriggerWall(nHWall, pXHWall, kCmdWallTouch, nSprite); + trTriggerWall(nHWall, pXHWall, kCmdWallTouch); } } @@ -4798,10 +4798,10 @@ void MoveDude(spritetype *pSprite) } if (!gModernMap && pHitXSprite && pHitXSprite->Touch && !pHitXSprite->state && !pHitXSprite->isTriggered) - trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpriteTouch, nSprite); + trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpriteTouch); if (pDudeInfo->lockOut && pHitXSprite && pHitXSprite->Push && !pHitXSprite->key && !pHitXSprite->DudeLockout && !pHitXSprite->state && !pHitXSprite->busy && !pPlayer) - trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpritePush, nSprite); + trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpritePush); break; } @@ -4813,7 +4813,7 @@ void MoveDude(spritetype *pSprite) if (pHitWall->extra > 0) pHitXWall = &xwall[pHitWall->extra]; if (pDudeInfo->lockOut && pHitXWall && pHitXWall->triggerPush && !pHitXWall->key && !pHitXWall->dudeLockout && !pHitXWall->state && !pHitXWall->busy && !pPlayer) - trTriggerWall(nHitWall, pHitXWall, kCmdWallPush, nSprite); + trTriggerWall(nHitWall, pHitXWall, kCmdWallPush); if (pHitWall->nextsector != -1) { sectortype *pHitSector = §or[pHitWall->nextsector]; @@ -4821,7 +4821,7 @@ void MoveDude(spritetype *pSprite) if (pHitSector->extra > 0) pHitXSector = &xsector[pHitSector->extra]; if (pDudeInfo->lockOut && pHitXSector && pHitXSector->Wallpush && !pHitXSector->Key && !pHitXSector->dudeLockout && !pHitXSector->state && !pHitXSector->busy && !pPlayer) - trTriggerSector(pHitWall->nextsector, pHitXSector, kCmdSectorPush, nSprite); + trTriggerSector(pHitWall->nextsector, pHitXSector, kCmdSectorPush); if (top < pHitSector->ceilingz || bottom > pHitSector->floorz) { // ??? @@ -4847,7 +4847,7 @@ void MoveDude(spritetype *pSprite) else pXSector = NULL; if (pXSector && pXSector->Exit && (pPlayer || !pXSector->dudeLockout)) - trTriggerSector(pSprite->sectnum, pXSector, kCmdSectorExit, nSprite); + trTriggerSector(pSprite->sectnum, pXSector, kCmdSectorExit); ChangeSpriteSect(nSprite, nSector); nXSector = sector[nSector].extra; @@ -4856,7 +4856,7 @@ void MoveDude(spritetype *pSprite) if (sector[nSector].type == kSectorTeleport) pXSector->data = pPlayer ? nSprite : -1; - trTriggerSector(nSector, pXSector, kCmdSectorEnter, nSprite); + trTriggerSector(nSector, pXSector, kCmdSectorEnter); } nSector = pSprite->sectnum; @@ -5359,7 +5359,7 @@ int MoveMissile(spritetype *pSprite) XWALL *pXWall = &xwall[pWall->extra]; if (pXWall->triggerVector) { - trTriggerWall(gHitInfo.hitwall, pXWall, kCmdWallImpact, nSprite); + trTriggerWall(gHitInfo.hitwall, pXWall, kCmdWallImpact); if (!(pWall->cstat&64)) { vdi = -1; @@ -5428,7 +5428,7 @@ void actExplodeSprite(spritetype *pSprite) return; sfxKill3DSound(pSprite, -1, -1); evKill(pSprite->index, 3); - int nType = kExplosionStandard; + int nType; switch (pSprite->type) { case kMissileFireballNapam: @@ -5623,7 +5623,7 @@ void actProcessSprites(void) if ((sprite[nAffected].flags & 32) || xsprite[sprite[nAffected].extra].health <= 0) continue; else if (CheckProximity(&sprite[nAffected], x, y, z, sectnum, 96)) { - trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity, nAffected); + trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity); break; } } @@ -5632,7 +5632,7 @@ void actProcessSprites(void) for (int a = connecthead; a >= 0; a = connectpoint2[a]) { if (gPlayer[a].pXSprite->health > 0 && CheckProximity(gPlayer[a].pSprite, x, y, z, sectnum, 96)) { - trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity, gPlayer[a].pSprite->index); + trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity); break; } } @@ -5657,7 +5657,7 @@ void actProcessSprites(void) for (int a = connecthead; a >= 0; a = connectpoint2[a]) { spritetype* pPlaySprite = gPlayer[a].pSprite; if (gPlayer[a].pXSprite->health > 0 && cansee(x, y, z, sectnum, pPlaySprite->x, pPlaySprite->y, pPlaySprite->z, pPlaySprite->sectnum)) { - trTriggerSprite(index, pXSightSpr, kCmdSpriteSight, pPlaySprite->index); + trTriggerSprite(index, pXSightSpr, kCmdSpriteSight); break; } } @@ -5803,7 +5803,7 @@ void actProcessSprites(void) break; } if (pSprite->owner == -1) actPropagateSpriteOwner(pSprite, pSprite2); - trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity, pSprite2->index); + trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity); } } } @@ -5879,7 +5879,7 @@ void actProcessSprites(void) { XSPRITE *pXSprite = &xsprite[nXSprite]; if (pXSprite->Impact) - trTriggerSprite(nSprite, pXSprite, kCmdOff, -1); + trTriggerSprite(nSprite, pXSprite, kCmdOff); switch (pSprite->type) { case kThingDripWater: case kThingDripBlood: @@ -5986,7 +5986,7 @@ void actProcessSprites(void) if (nWall == -1) break; XWALL *pXWall = &xwall[wall[nWall].extra]; - trTriggerWall(nWall, pXWall, kCmdWallImpact, nSprite); + trTriggerWall(nWall, pXWall, kCmdWallImpact); } for (int nSprite2 = headspritestat[kStatDude]; nSprite2 >= 0; nSprite2 = nextspritestat[nSprite2]) @@ -6169,7 +6169,7 @@ void actProcessSprites(void) pXIncarnation->triggerOff = false; // trigger dude death before transform - trTriggerSprite(nSprite, pXSprite, kCmdOff, pSprite->owner); + trTriggerSprite(nSprite, pXSprite, kCmdOff); pSprite->type = pIncarnation->type; pSprite->flags = pIncarnation->flags; @@ -6257,7 +6257,7 @@ void actProcessSprites(void) } else { if (pXSprite->sysData1 == kGenDudeTransformStatus) pXSprite->sysData1 = 0; // just trigger dude death - trTriggerSprite(nSprite, pXSprite, kCmdOff, pSprite->owner); + trTriggerSprite(nSprite, pXSprite, kCmdOff); } } } @@ -6285,7 +6285,7 @@ void actProcessSprites(void) XSPRITE *pXSprite2 = &xsprite[pSprite2->extra]; if ((unsigned int)pXSprite2->health > 0 && IsPlayerSprite(pSprite2)) { if (CheckProximity(pSprite2, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 128)) - trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity, pSprite2->index); + trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity); } } } @@ -6961,7 +6961,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, { XWALL *pXWall = &xwall[nXWall]; if (pXWall->triggerVector) - trTriggerWall(nWall, pXWall, kCmdWallImpact, nShooter); + trTriggerWall(nWall, pXWall, kCmdWallImpact); } break; } @@ -6983,7 +6983,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, { XSPRITE *pXSprite = &xsprite[nXSprite]; if (pXSprite->Vector) - trTriggerSprite(nSprite, pXSprite, kCmdSpriteImpact, nShooter); + trTriggerSprite(nSprite, pXSprite, kCmdSpriteImpact); } if (pSprite->statnum == kStatThing) { @@ -7857,8 +7857,8 @@ void debrisMove(int listIndex) { changespritestat(nSprite, kStatThing); - if (pXDebris->state == 1) trTriggerSprite(pSprite->xvel, pXDebris, kCmdOff, -1); - else trTriggerSprite(pSprite->xvel, pXDebris, kCmdOn, -1); + if (pXDebris->state == 1) trTriggerSprite(pSprite->xvel, pXDebris, kCmdOff); + else trTriggerSprite(pSprite->xvel, pXDebris, kCmdOn); } } diff --git a/source/blood/src/aicult.cpp b/source/blood/src/aicult.cpp index 086bc27f4..317bfae86 100644 --- a/source/blood/src/aicult.cpp +++ b/source/blood/src/aicult.cpp @@ -181,7 +181,7 @@ static void ThrowSeqCallback(int, int nXSprite) if (v4) xsprite[pMissile->extra].Impact = 1; else - evPost(pMissile->index, 3, 120*(1+Random(2)), kCmdOn, nSprite); + evPost(pMissile->index, 3, 120*(1+Random(2)), kCmdOn); } static void sub_68170(int, int nXSprite) @@ -194,7 +194,7 @@ static void sub_68170(int, int nXSprite) nMissile = kThingArmedTNTBundle; sfxPlay3DSound(pSprite, 455, -1, 0); spritetype *pMissile = actFireThing(pSprite, 0, 0, gDudeSlope[nXSprite]-9460, nMissile, 0x133333); - evPost(pMissile->index, 3, 120*(2+Random(2)), kCmdOn, nSprite); + evPost(pMissile->index, 3, 120*(2+Random(2)), kCmdOn); } static void sub_68230(int, int nXSprite) diff --git a/source/blood/src/aiunicult.cpp b/source/blood/src/aiunicult.cpp index 388bf9799..6940349d8 100644 --- a/source/blood/src/aiunicult.cpp +++ b/source/blood/src/aiunicult.cpp @@ -400,7 +400,7 @@ static void ThrowThing(int nXIndex, bool impact) { if (impact == true && dist <= 7680) xsprite[pThing->extra].Impact = true; else { xsprite[pThing->extra].Impact = false; - evPost(pThing->xvel, 3, 120 * Random(2) + 120, kCmdOn, pXSprite->reference); + evPost(pThing->xvel, 3, 120 * Random(2) + 120, kCmdOn); } } diff --git a/source/blood/src/callback.cpp b/source/blood/src/callback.cpp index 4dc66fb51..6ed39027d 100644 --- a/source/blood/src/callback.cpp +++ b/source/blood/src/callback.cpp @@ -361,7 +361,7 @@ void CounterCheck(int nSector) // 12 return; } else { //pXSector->waitTimeA = 0; //do not reset necessary objects counter to zero - trTriggerSector(nSector, pXSector, kCmdOn, -1); + trTriggerSector(nSector, pXSector, kCmdOn); pXSector->locked = 1; //lock sector, so it can be opened again later } } @@ -489,13 +489,13 @@ void returnFlagToBase(int nSprite) // 17 XSPRITE* pXOwner = &xsprite[pOwner->extra]; switch (pSprite->type) { case kItemFlagA: - trTriggerSprite(pOwner->index, pXOwner, kCmdOn, pOwner->index); + trTriggerSprite(pOwner->index, pXOwner, kCmdOn); sndStartSample(8003, 255, 2, 0); gBlueFlagDropped = false; viewSetMessage("Blue Flag returned to base."); break; case kItemFlagB: - trTriggerSprite(pOwner->index, pXOwner, kCmdOn, pOwner->index); + trTriggerSprite(pOwner->index, pXOwner, kCmdOn); sndStartSample(8002, 255, 2, 0); gRedFlagDropped = false; viewSetMessage("Red Flag returned to base."); diff --git a/source/blood/src/eventq.cpp b/source/blood/src/eventq.cpp index 26b16125e..f66c17eb8 100644 --- a/source/blood/src/eventq.cpp +++ b/source/blood/src/eventq.cpp @@ -351,7 +351,7 @@ char evGetSourceState(int nType, int nIndex) return 0; } -void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy) +void evSend(int nIndex, int nType, int rxId, COMMAND_ID command) { @@ -370,7 +370,6 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy) event.index = nIndex; event.type = nType; event.cmd = command; - event.causedBy = causedBy; switch (rxId) { case kChannelTextOver: @@ -452,9 +451,6 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy) if ((pPlayer = getPlayerById(i)) != NULL) trMessageSprite(pPlayer->nSprite, event); } - // send command on sprite which create the event sequence - } else if (rxId == kChannelEventCauser && spriRangeIsFine(event.causedBy)) { - trMessageSprite(event.causedBy, event); } } @@ -488,7 +484,7 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy) } } -void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command, short causedBy) { +void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command) { dassert(command != kCmdCallback); if (command == kCmdState) command = evGetSourceState(nType, nIndex) ? kCmdOn : kCmdOff; else if (command == kCmdNotState) command = evGetSourceState(nType, nIndex) ? kCmdOff : kCmdOn; @@ -496,17 +492,15 @@ void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command, shor evn.index = nIndex; evn.type = nType; evn.cmd = command; - evn.causedBy = causedBy; eventQ.PQueue->Insert((int)gFrameClock+nDelta, evn); } -void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback, short causedBy) { +void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback) { EVENT evn = {}; evn.index = nIndex; evn.type = nType; evn.cmd = kCmdCallback; evn.funcID = callback; - evn.causedBy = causedBy; eventQ.PQueue->Insert((int)gFrameClock+nDelta, evn); } diff --git a/source/blood/src/eventq.h b/source/blood/src/eventq.h index 057cbcf70..1c576194c 100644 --- a/source/blood/src/eventq.h +++ b/source/blood/src/eventq.h @@ -129,14 +129,13 @@ struct EVENT { unsigned int type: 3; // type unsigned int cmd: 8; // cmd unsigned int funcID: 8; // callback - signed int causedBy: 14; // by NoOne: spritenum of object which initiated this event (-1 == initiated by the game) }; void evInit(void); char evGetSourceState(int nType, int nIndex); -void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy); -void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command, short causedBy); -void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback, short causedBy = -1); +void evSend(int nIndex, int nType, int rxId, COMMAND_ID command); +void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command); +void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback); void evProcess(unsigned int nTime); void evKill(int a1, int a2); void evKill(int a1, int a2, CALLBACK_ID a3); diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index 07d1eaac7..1749230ad 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -991,7 +991,7 @@ void playerResetPosture(PLAYER* pPlayer) { void playerResetQavScene(PLAYER* pPlayer) { QAVSCENE* pQavScene = &gPlayerCtrl[pPlayer->nPlayer].qavScene; - pQavScene->index = pQavScene->causedBy = pPlayer->sceneQav = -1; + pQavScene->index = pQavScene->dummy = pPlayer->sceneQav = -1; pQavScene->qavResrc = NULL; } @@ -1062,7 +1062,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { if ((pPlayer->hasFlag & 1) == 0 && pXItem->state) { pPlayer->hasFlag |= 1; pPlayer->used2[0] = pItem->index; - trTriggerSprite(pItem->index, pXItem, kCmdOff, pPlayer->nSprite); + trTriggerSprite(pItem->index, pXItem, kCmdOff); sprintf(buffer, "%s stole Blue Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8007, 255, 2, 0); viewSetMessage(buffer); @@ -1074,7 +1074,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { if ((pPlayer->hasFlag & 1) != 0 && !pXItem->state) { pPlayer->hasFlag &= ~1; pPlayer->used2[0] = -1; - trTriggerSprite(pItem->index, pXItem, kCmdOn, pPlayer->nSprite); + trTriggerSprite(pItem->index, pXItem, kCmdOn); sprintf(buffer, "%s returned Blue Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8003, 255, 2, 0); viewSetMessage(buffer); @@ -1085,7 +1085,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { pPlayer->used2[1] = -1; dword_21EFB0[pPlayer->teamId] += 10; dword_21EFD0[pPlayer->teamId] += 240; - evSend(0, 0, 81, kCmdOn, pPlayer->nSprite); + evSend(0, 0, 81, kCmdOn); sprintf(buffer, "%s captured Red Flag!", gProfile[pPlayer->nPlayer].name); sndStartSample(8001, 255, 2, 0); viewSetMessage(buffer); @@ -1106,7 +1106,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { if ((pPlayer->hasFlag & 2) == 0 && pXItem->state) { pPlayer->hasFlag |= 2; pPlayer->used2[1] = pItem->index; - trTriggerSprite(pItem->index, pXItem, kCmdOff, pPlayer->nSprite); + trTriggerSprite(pItem->index, pXItem, kCmdOff); sprintf(buffer, "%s stole Red Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8006, 255, 2, 0); viewSetMessage(buffer); @@ -1118,7 +1118,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { { pPlayer->hasFlag &= ~2; pPlayer->used2[1] = -1; - trTriggerSprite(pItem->index, pXItem, kCmdOn, pPlayer->nSprite); + trTriggerSprite(pItem->index, pXItem, kCmdOn); sprintf(buffer, "%s returned Red Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8002, 255, 2, 0); viewSetMessage(buffer); @@ -1129,7 +1129,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { pPlayer->used2[0] = -1; dword_21EFB0[pPlayer->teamId] += 10; dword_21EFD0[pPlayer->teamId] += 240; - evSend(0, 0, 80, kCmdOn, pPlayer->nSprite); + evSend(0, 0, 80, kCmdOn); sprintf(buffer, "%s captured Blue Flag!", gProfile[pPlayer->nPlayer].name); sndStartSample(8000, 255, 2, 0); viewSetMessage(buffer); @@ -1305,7 +1305,7 @@ void PickUp(PLAYER *pPlayer, spritetype *pSprite) else if (pSprite->extra > 0) { XSPRITE *pXSprite = &xsprite[pSprite->extra]; if (pXSprite->Pickup) - trTriggerSprite(pSprite->index, pXSprite, kCmdSpritePickup, pPlayer->nSprite); + trTriggerSprite(pSprite->index, pXSprite, kCmdSpritePickup); } if (!actCheckRespawn(pSprite)) @@ -1400,7 +1400,7 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3) zvel[*a2] += mulscale16(z, t2); } if (pXSprite->Push && !pXSprite->state && !pXSprite->isTriggered) - trTriggerSprite(*a2, pXSprite, kCmdSpritePush, pPlayer->nSprite); + trTriggerSprite(*a2, pXSprite, kCmdSpritePush); } break; case 0: @@ -1607,7 +1607,7 @@ void ProcessInput(PLAYER *pPlayer) sndStartSample(3062, 255, 2, 0); } if (!key || pPlayer->hasKey[key]) - trTriggerSector(a2, pXSector, kCmdSpritePush, nSprite); + trTriggerSector(a2, pXSector, kCmdSpritePush); else if (pPlayer == gMe) { viewSetMessage(GStrings("TXTB_KEY")); @@ -1625,7 +1625,7 @@ void ProcessInput(PLAYER *pPlayer) sndStartSample(3062, 255, 2, 0); } if (!key || pPlayer->hasKey[key]) - trTriggerWall(a2, pXWall, kCmdWallPush, pPlayer->nSprite); + trTriggerWall(a2, pXWall, kCmdWallPush); else if (pPlayer == gMe) { viewSetMessage(GStrings("TXTB_KEY")); @@ -1640,7 +1640,7 @@ void ProcessInput(PLAYER *pPlayer) if (pXSprite->locked && pPlayer == gMe && pXSprite->lockMsg) trTextOver(pXSprite->lockMsg); if (!key || pPlayer->hasKey[key]) - trTriggerSprite(a2, pXSprite, kCmdSpritePush, pPlayer->nSprite); + trTriggerSprite(a2, pXSprite, kCmdSpritePush); else if (pPlayer == gMe) { viewSetMessage(GStrings("TXTB_KEY")); @@ -2012,16 +2012,16 @@ void FragPlayer(PLAYER *pPlayer, int nSprite) if (nTeam1 == 0) { if (nTeam1 != nTeam2) - evSend(0, 0, 15, kCmdToggle, pKiller->nSprite); + evSend(0, 0, 15, kCmdToggle); else - evSend(0, 0, 16, kCmdToggle, pKiller->nSprite); + evSend(0, 0, 16, kCmdToggle); } else { if (nTeam1 == nTeam2) - evSend(0, 0, 16, kCmdToggle, pKiller->nSprite); + evSend(0, 0, 16, kCmdToggle); else - evSend(0, 0, 15, kCmdToggle, pKiller->nSprite); + evSend(0, 0, 15, kCmdToggle); } } } @@ -2203,7 +2203,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in { powerupClear(pPlayer); if (nXSector > 0 && xsector[nXSector].Exit) - trTriggerSector(pSprite->sectnum, &xsector[nXSector], kCmdSectorExit, nSprite); + trTriggerSector(pSprite->sectnum, &xsector[nXSector], kCmdSectorExit); pSprite->flags |= 7; for (int p = connecthead; p >= 0; p = connectpoint2[p]) { @@ -2211,7 +2211,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in gPlayer[p].fraggerId = -1; } FragPlayer(pPlayer, nSource); - trTriggerSprite(nSprite, pXSprite, kCmdOff, nSource); + trTriggerSprite(nSprite, pXSprite, kCmdOff); } dassert(gSysRes.Lookup(pDudeInfo->seqStartID + nDeathSeqID, "SEQ") != NULL); seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, 3, nXSprite, nKneelingPlayer); diff --git a/source/blood/src/player.h b/source/blood/src/player.h index 4a9c29732..a964294ee 100644 --- a/source/blood/src/player.h +++ b/source/blood/src/player.h @@ -202,8 +202,6 @@ struct PLAYER POSTURE pPosture[kModeMax][kPostureMax]; }; - - struct PROFILE { int nAutoAim; @@ -226,21 +224,15 @@ struct POWERUPINFO int maxTime; }; - -#define kQavSceneStackSize 16 // by NoOne: this one stores qavs anims that can be played by trigger -struct QAVSCENE -{ - short index = -1; // index of sprite which triggered qav scene +struct QAVSCENE { + short index = -1; // index of sprite which triggered qav scene QAV * qavResrc = NULL; - short causedBy = -1; - - // TO-DO: Stack of animations which allows to pop and push (restoring previous animation instead of weapon once current animation is played) + short dummy = -1; }; // by NoOne: this one for controlling the player using triggers (movement speed, jumps and other stuff) -struct TRPLAYERCTRL -{ +struct TRPLAYERCTRL { QAVSCENE qavScene; }; diff --git a/source/blood/src/triggers.cpp b/source/blood/src/triggers.cpp index 61061de88..1b3b2a2e7 100644 --- a/source/blood/src/triggers.cpp +++ b/source/blood/src/triggers.cpp @@ -87,7 +87,7 @@ unsigned int GetWaveValue(unsigned int nPhase, int nType) return nPhase; } -char SetSpriteState(int nSprite, XSPRITE* pXSprite, int nState, short causedBy) +char SetSpriteState(int nSprite, XSPRITE* pXSprite, int nState) { if ((pXSprite->busy & 0xffff) == 0 && pXSprite->state == nState) return 0; @@ -101,18 +101,18 @@ char SetSpriteState(int nSprite, XSPRITE* pXSprite, int nState, short causedBy) return 1; } if (pXSprite->restState != nState && pXSprite->waitTime > 0) - evPost(nSprite, 3, (pXSprite->waitTime * 120) / 10, pXSprite->restState ? kCmdOn : kCmdOff, causedBy); + evPost(nSprite, 3, (pXSprite->waitTime * 120) / 10, pXSprite->restState ? kCmdOn : kCmdOff); if (pXSprite->txID) { if (pXSprite->command != kCmdLink && pXSprite->triggerOn && pXSprite->state) - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, causedBy); + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); if (pXSprite->command != kCmdLink && pXSprite->triggerOff && !pXSprite->state) - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, causedBy); + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); } return 1; } -char modernTypeSetSpriteState(int nSprite, XSPRITE *pXSprite, int nState, short causedBy) +char modernTypeSetSpriteState(int nSprite, XSPRITE *pXSprite, int nState) { if ((pXSprite->busy&0xffff) == 0 && pXSprite->state == nState) return 0; pXSprite->busy = nState<<16; @@ -120,12 +120,12 @@ char modernTypeSetSpriteState(int nSprite, XSPRITE *pXSprite, int nState, short evKill(nSprite, 3); if ((sprite[nSprite].flags & kHitagRespawn) != 0 && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax) { pXSprite->respawnPending = 3; - evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn, causedBy); + evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn); return 1; } if (pXSprite->restState != nState && pXSprite->waitTime > 0) - evPost(nSprite, 3, (pXSprite->waitTime*120) / 10, pXSprite->restState ? kCmdOn : kCmdOff, causedBy); + evPost(nSprite, 3, (pXSprite->waitTime*120) / 10, pXSprite->restState ? kCmdOn : kCmdOff); if (pXSprite->txID != 0 && ((pXSprite->triggerOn && pXSprite->state) || (pXSprite->triggerOff && !pXSprite->state))) { @@ -134,15 +134,15 @@ char modernTypeSetSpriteState(int nSprite, XSPRITE *pXSprite, int nState, short switch (pXSprite->command) { case kCmdLink: case kCmdModernUse: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, causedBy); // just send command to change properties + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // just send command to change properties return 1; case kCmdUnlock: - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, causedBy); // send normal command first - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, causedBy); // then send command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // send normal command first + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // then send command to change properties return 1; default: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, causedBy); // send first command to change properties - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, causedBy); // then send normal command + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // send first command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // then send normal command return 1; } @@ -150,7 +150,7 @@ char modernTypeSetSpriteState(int nSprite, XSPRITE *pXSprite, int nState, short return 1; } -char SetWallState(int nWall, XWALL *pXWall, int nState, short causedBy) +char SetWallState(int nWall, XWALL *pXWall, int nState) { if ((pXWall->busy&0xffff) == 0 && pXWall->state == nState) return 0; @@ -158,18 +158,18 @@ char SetWallState(int nWall, XWALL *pXWall, int nState, short causedBy) pXWall->state = nState; evKill(nWall, 0); if (pXWall->restState != nState && pXWall->waitTime > 0) - evPost(nWall, 0, (pXWall->waitTime*120) / 10, pXWall->restState ? kCmdOn : kCmdOff, causedBy); + evPost(nWall, 0, (pXWall->waitTime*120) / 10, pXWall->restState ? kCmdOn : kCmdOff); if (pXWall->txID) { if (pXWall->command != kCmdLink && pXWall->triggerOn && pXWall->state) - evSend(nWall, 0, pXWall->txID, (COMMAND_ID)pXWall->command, causedBy); + evSend(nWall, 0, pXWall->txID, (COMMAND_ID)pXWall->command); if (pXWall->command != kCmdLink && pXWall->triggerOff && !pXWall->state) - evSend(nWall, 0, pXWall->txID, (COMMAND_ID)pXWall->command, causedBy); + evSend(nWall, 0, pXWall->txID, (COMMAND_ID)pXWall->command); } return 1; } -char SetSectorState(int nSector, XSECTOR *pXSector, int nState, short causedBy) +char SetSectorState(int nSector, XSECTOR *pXSector, int nState) { if ((pXSector->busy&0xffff) == 0 && pXSector->state == nState) return 0; @@ -179,26 +179,26 @@ char SetSectorState(int nSector, XSECTOR *pXSector, int nState, short causedBy) if (nState == 1) { if (pXSector->command != kCmdLink && pXSector->triggerOn && pXSector->txID) - evSend(nSector, 6, pXSector->txID, (COMMAND_ID)pXSector->command, causedBy); + evSend(nSector, 6, pXSector->txID, (COMMAND_ID)pXSector->command); if (pXSector->stopOn) { pXSector->stopOn = 0; pXSector->stopOff = 0; } else if (pXSector->reTriggerA) - evPost(nSector, 6, (pXSector->waitTimeA * 120) / 10, kCmdOff, causedBy); + evPost(nSector, 6, (pXSector->waitTimeA * 120) / 10, kCmdOff); } else { if (pXSector->command != kCmdLink && pXSector->triggerOff && pXSector->txID) - evSend(nSector, 6, pXSector->txID, (COMMAND_ID)pXSector->command, causedBy); + evSend(nSector, 6, pXSector->txID, (COMMAND_ID)pXSector->command); if (pXSector->stopOff) { pXSector->stopOn = 0; pXSector->stopOff = 0; } else if (pXSector->reTriggerB) - evPost(nSector, 6, (pXSector->waitTimeB * 120) / 10, kCmdOn, causedBy); + evPost(nSector, 6, (pXSector->waitTimeB * 120) / 10, kCmdOn); } return 1; } @@ -410,13 +410,13 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kDudePlayer8: switch (event.cmd) { case kCmdOff: - SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: - SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, 1); break; default: - SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); break; } return; @@ -433,7 +433,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) switch (pXSprite->command) { case kCmdLink: if (pXSprite->txID <= 0) return; - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); return; } break; // go normal operate switch @@ -470,7 +470,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) } pXSprite->txID = (tx > 0 && tx < kChannelUserMax) ? tx : 0; - SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); } return; // Sequential Switch takes values from data fields starting from data1 and uses it as TX ID @@ -490,7 +490,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) if (pSprite->flags & kModernTypeFlag1) { for (pXSprite->txID = pXSprite->data1; pXSprite->txID <= pXSprite->data4; pXSprite->txID++) { if (pXSprite->txID > 0) - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); } pXSprite->txID = pXSprite->sysData1 = 0; @@ -509,7 +509,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) if (pSprite->flags & kModernTypeFlag1) { for (int i = 0; i <= 3; i++) { if ((pXSprite->txID = GetDataVal(pSprite, i)) > 0) - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); } pXSprite->txID = pXSprite->sysData1 = 0; @@ -563,15 +563,14 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) } pXSprite->txID = (tx > 0 && tx < kChannelUserMax) ? tx : 0; - SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); } return; case kMarkerWarpDest: if (pXSprite->txID <= 0) { - if (SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy) == 1) { - if (pXSprite->data1 == 0 && spriRangeIsFine(event.causedBy)) useTeleportTarget(pXSprite, &sprite[event.causedBy]); - else if (pXSprite->data1 > 0) { + if (SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1) == 1) { + if (pXSprite->data1 > 0) { PLAYER* pPlayer = getPlayerById(pXSprite->data1); if (pPlayer != NULL) useTeleportTarget(pXSprite, pPlayer->pSprite); @@ -579,14 +578,13 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) } return; } - modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); return; case kModernSpriteDamager: if (pXSprite->txID <= 0) { - if (SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy) == 1) { - if (pXSprite->data1 == 0 && spriRangeIsFine(event.causedBy)) useSpriteDamager(pXSprite, &sprite[event.causedBy]); - else if (pXSprite->data1 > 0) { + if (SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1) == 1) { + if (pXSprite->data1 > 0) { PLAYER* pPlayer = getPlayerById(pXSprite->data1); if (pPlayer != NULL) useSpriteDamager(pXSprite, pPlayer->pSprite); @@ -594,30 +592,25 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) } return; } - modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); return; case kModernObjPropertiesChanger: if (pXSprite->txID <= 0) { - if (SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy) == 1) + if (SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1) == 1) usePropertiesChanger(pXSprite, -1, -1); return; } - modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); return; case kModernObjSizeChanger: - if (pXSprite->txID <= 0 && spriRangeIsFine(event.causedBy)) { - if (SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy) == 1) - useObjResizer(pXSprite, 3, event.causedBy); - return; - } - modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); return; case kModernObjPicnumChanger: case kModernSectorFXChanger: case kModernObjDataChanger: - modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); return; case kModernCustomDudeSpawn: @@ -629,11 +622,11 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kModernEffectSpawner: switch (event.cmd) { case kCmdOff: - if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: evKill(nSprite, 3); // queue overflow protect - if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1); fallthrough__; case kCmdRepeat: if (pXSprite->txID <= 0) @@ -642,26 +635,26 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) switch (pXSprite->command) { case kCmdLink: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // just send command to change properties + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // just send command to change properties break; case kCmdUnlock: - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // send normal command first - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // then send command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // send normal command first + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // then send command to change properties break; default: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // send first command to change properties - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // then send normal command + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // send first command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // then send normal command break; } } if (pXSprite->busyTime > 0) - evPost(nSprite, 3, ClipLow((int(pXSprite->busyTime) + Random2(pXSprite->data1)) * 120 / 10, 0), kCmdRepeat, event.causedBy); + evPost(nSprite, 3, ClipLow((int(pXSprite->busyTime) + Random2(pXSprite->data1)) * 120 / 10, 0), kCmdRepeat); break; default: - if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn, event.causedBy); - else evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn); + else evPost(nSprite, 3, 0, kCmdOff); break; } return; @@ -670,11 +663,11 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) switch (event.cmd) { case kCmdOff: stopWindOnSectors(pXSprite); - if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: evKill(nSprite, 3); // queue overflow protect - if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1); fallthrough__; case kCmdRepeat: if (pXSprite->txID <= 0) useSectorWindGen(pXSprite, NULL); @@ -682,25 +675,25 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) switch (pXSprite->command) { case kCmdLink: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // just send command to change properties + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // just send command to change properties break; case kCmdUnlock: - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // send normal command first - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // then send command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // send normal command first + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // then send command to change properties break; default: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // send first command to change properties - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // then send normal command + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // send first command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // then send normal command break; } } - if (pXSprite->busyTime > 0) evPost(nSprite, 3, pXSprite->busyTime, kCmdRepeat, event.causedBy); + if (pXSprite->busyTime > 0) evPost(nSprite, 3, pXSprite->busyTime, kCmdRepeat); break; default: - if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn, event.causedBy); - else evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn); + else evPost(nSprite, 3, 0, kCmdOff); break; } return; @@ -719,41 +712,41 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) switch (event.cmd) { case kCmdOff: if (pXSprite->data4 == 3 && activated == false) activateDudes(pXSprite->txID); - if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: evKill(nSprite, 3); // queue overflow protect - if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1); fallthrough__; case kCmdRepeat: if (pXSprite->txID <= 0 || !getDudesForTargetChg(pXSprite)) { freeAllTargets(pXSprite); - evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + evPost(nSprite, 3, 0, kCmdOff); break; } else { switch (pXSprite->command) { case kCmdLink: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // just send command to change properties + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // just send command to change properties break; case kCmdUnlock: - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // send normal command first - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // then send command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // send normal command first + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // then send command to change properties break; default: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // send first command to change properties - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // then send normal command + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // send first command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // then send normal command break; } } - if (pXSprite->busyTime > 0) evPost(nSprite, 3, pXSprite->busyTime, kCmdRepeat, event.causedBy); + if (pXSprite->busyTime > 0) evPost(nSprite, 3, pXSprite->busyTime, kCmdRepeat); break; default: - if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn, event.causedBy); - else evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn); + else evPost(nSprite, 3, 0, kCmdOff); break; } @@ -764,17 +757,17 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kModernObjDataAccumulator: switch (event.cmd) { case kCmdOff: - if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: evKill(nSprite, 3); // queue overflow protect - if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1); fallthrough__; case kCmdRepeat: // force OFF after *all* TX objects reach the goal value if (pSprite->flags == 0 && goalValueIsReached(pXSprite)) { - evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + evPost(nSprite, 3, 0, kCmdOff); break; } @@ -782,24 +775,24 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) switch (pXSprite->command) { case kCmdLink: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // just send command to change properties + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // just send command to change properties break; case kCmdUnlock: - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // send normal command first - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // then send command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // send normal command first + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // then send command to change properties break; default: - evSend(nSprite, 3, pXSprite->txID, kCmdModernUse, event.causedBy); // send first command to change properties - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); // then send normal command + evSend(nSprite, 3, pXSprite->txID, kCmdModernUse); // send first command to change properties + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); // then send normal command break; } - if (pXSprite->busyTime > 0) evPost(nSprite, 3, pXSprite->busyTime, kCmdRepeat, event.causedBy); + if (pXSprite->busyTime > 0) evPost(nSprite, 3, pXSprite->busyTime, kCmdRepeat); } break; default: - if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn, event.causedBy); - else evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn); + else evPost(nSprite, 3, 0, kCmdOff); break; } return; @@ -808,20 +801,20 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kModernRandom2: switch (event.cmd) { case kCmdOff: - if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: evKill(nSprite, 3); // queue overflow protect - if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1); fallthrough__; case kCmdRepeat: ActivateGenerator(nSprite); if (pXSprite->busyTime > 0) - evPost(nSprite, 3, (120 * pXSprite->busyTime) / 10, kCmdRepeat, event.causedBy); + evPost(nSprite, 3, (120 * pXSprite->busyTime) / 10, kCmdRepeat); break; default: - if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn, event.causedBy); - else evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn); + else evPost(nSprite, 3, 0, kCmdOff); break; } return; @@ -833,38 +826,35 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kGenModernMissileUniversal: switch (event.cmd) { case kCmdOff: - if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + if (pXSprite->state == 1) SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: evKill(nSprite, 3); // queue overflow protect - if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + if (pXSprite->state == 0) SetSpriteState(nSprite, pXSprite, 1); fallthrough__; case kCmdRepeat: ActivateGenerator(nSprite); - if (pXSprite->txID) evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); - if (pXSprite->busyTime > 0) evPost(nSprite, 3, (120 * pXSprite->busyTime) / 10, kCmdRepeat, event.causedBy); + if (pXSprite->txID) evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); + if (pXSprite->busyTime > 0) evPost(nSprite, 3, (120 * pXSprite->busyTime) / 10, kCmdRepeat); break; default: - if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn, event.causedBy); - else evPost(nSprite, 3, 0, kCmdOff, event.causedBy); + if (pXSprite->state == 0) evPost(nSprite, 3, 0, kCmdOn); + else evPost(nSprite, 3, 0, kCmdOff); break; } return; case kModernPlayerControl: // WIP PLAYER* pPlayer = NULL; int nPlayer = pXSprite->data1; int oldCmd = -1; - if (pXSprite->data1 == 0 && spriRangeIsFine(event.causedBy)) - nPlayer = sprite[event.causedBy].type; - if ((pPlayer = getPlayerById(nPlayer)) == NULL || pPlayer->pXSprite->health <= 0) return; else if (pXSprite->command < kCmdNumberic + 3 && pXSprite->command > kCmdNumberic + 4 - && !modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy)) return; + && !modernTypeSetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1)) return; TRPLAYERCTRL* pCtrl = &gPlayerCtrl[pPlayer->nPlayer]; if (event.cmd >= kCmdNumberic) { switch (event.cmd) { case kCmdNumberic + 3: // start playing qav scene if (pCtrl->qavScene.index != nSprite || pXSprite->Interrutable) - trPlayerCtrlStartScene(pXSprite, pPlayer, event.causedBy); + trPlayerCtrlStartScene(pXSprite, pPlayer); return; case kCmdNumberic + 4: { // stop playing qav scene int scnIndex = pCtrl->qavScene.index; @@ -975,7 +965,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kCmdNumberic + 3: // 67 // start playing qav scene if (pCtrl->qavScene.index != nSprite || pXSprite->Interrutable) - trPlayerCtrlStartScene(pXSprite, pPlayer, event.causedBy); + trPlayerCtrlStartScene(pXSprite, pPlayer); break; case kCmdNumberic + 4: // 68 @@ -1118,7 +1108,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) switch (event.cmd) { case kCmdOff: - SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + SetSpriteState(nSprite, pXSprite, 0); break; case kCmdSpriteProximity: if (pXSprite->state) break; @@ -1126,7 +1116,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kCmdOn: case kCmdSpritePush: case kCmdSpriteTouch: - if (!pXSprite->state) SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + if (!pXSprite->state) SetSpriteState(nSprite, pXSprite, 1); aiActivateDude(pSprite, pXSprite); break; } @@ -1140,11 +1130,11 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) if (pXSprite->health <= 0) break; switch (event.cmd) { case kCmdOff: - if (!SetSpriteState(nSprite, pXSprite, 0, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 0)) break; seqSpawn(40, 3, pSprite->extra, -1); break; case kCmdOn: - if (!SetSpriteState(nSprite, pXSprite, 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 1)) break; seqSpawn(38, 3, pSprite->extra, nMGunOpenClient); if (pXSprite->data1 > 0) pXSprite->data2 = pXSprite->data1; @@ -1152,15 +1142,15 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) } break; case kThingFallingRock: - if (SetSpriteState(nSprite, pXSprite, 1, event.causedBy)) + if (SetSpriteState(nSprite, pXSprite, 1)) pSprite->flags |= 7; break; case kThingWallCrack: - if (SetSpriteState(nSprite, pXSprite, 0, event.causedBy)) + if (SetSpriteState(nSprite, pXSprite, 0)) actPostSprite(nSprite, kStatFree); break; case kThingCrateFace: - if (SetSpriteState(nSprite, pXSprite, 0, event.causedBy)) + if (SetSpriteState(nSprite, pXSprite, 0)) actPostSprite(nSprite, kStatFree); break; case kTrapZapSwitchable: @@ -1185,12 +1175,12 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kTrapFlame: switch (event.cmd) { case kCmdOff: - if (!SetSpriteState(nSprite, pXSprite, 0, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 0)) break; seqSpawn(40, 3, pSprite->extra, -1); sfxKill3DSound(pSprite, 0, -1); break; case kCmdOn: - if (SetSpriteState(nSprite, pXSprite, 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 1)) break; seqSpawn(38, 3, pSprite->extra, -1); sfxPlay3DSound(pSprite, 441, 0, 0); break; @@ -1199,14 +1189,14 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kSwitchPadlock: switch (event.cmd) { case kCmdOff: - SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: - if (!SetSpriteState(nSprite, pXSprite, 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 1)) break; seqSpawn(37, 3, pSprite->extra, -1); break; default: - SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); if (pXSprite->state) seqSpawn(37, 3, pSprite->extra, -1); break; } @@ -1214,15 +1204,15 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kSwitchToggle: switch (event.cmd) { case kCmdOff: - if (!SetSpriteState(nSprite, pXSprite, 0, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 0)) break; sfxPlay3DSound(pSprite, pXSprite->data2, 0, 0); break; case kCmdOn: - if (!SetSpriteState(nSprite, pXSprite, 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 1)) break; sfxPlay3DSound(pSprite, pXSprite->data1, 0, 0); break; default: - if (!SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1)) break; if (pXSprite->state) sfxPlay3DSound(pSprite, pXSprite->data1, 0, 0); else sfxPlay3DSound(pSprite, pXSprite->data2, 0, 0); break; @@ -1231,15 +1221,15 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kSwitchOneWay: switch (event.cmd) { case kCmdOff: - if (!SetSpriteState(nSprite, pXSprite, 0, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 0)) break; sfxPlay3DSound(pSprite, pXSprite->data2, 0, 0); break; case kCmdOn: - if (!SetSpriteState(nSprite, pXSprite, 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 1)) break; sfxPlay3DSound(pSprite, pXSprite->data1, 0, 0); break; default: - if (!SetSpriteState(nSprite, pXSprite, pXSprite->restState ^ 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, pXSprite->restState ^ 1)) break; if (pXSprite->state) sfxPlay3DSound(pSprite, pXSprite->data1, 0, 0); else sfxPlay3DSound(pSprite, pXSprite->data2, 0, 0); break; @@ -1262,12 +1252,12 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) sfxPlay3DSound(pSprite, pXSprite->data4, -1, 0); if (pXSprite->command == kCmdLink && pXSprite->txID > 0) - evSend(nSprite, 3, pXSprite->txID, kCmdLink, event.causedBy); + evSend(nSprite, 3, pXSprite->txID, kCmdLink); if (pXSprite->data1 == pXSprite->data2) - SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, 1); else - SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + SetSpriteState(nSprite, pXSprite, 0); break; case kMarkerDudeSpawn: @@ -1308,7 +1298,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kMarkerEarthQuake: pXSprite->triggerOn = 0; pXSprite->isTriggered = 1; - SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, 1); for (int p = connecthead; p >= 0; p = connectpoint2[p]) { spritetype *pPlayerSprite = gPlayer[p].pSprite; int dx = (pSprite->x - pPlayerSprite->x)>>4; @@ -1329,7 +1319,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kTrapExploder: switch (event.cmd) { case kCmdOn: - SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, 1); break; default: pSprite->cstat &= (unsigned short)~CSTAT_SPRITE_INVISIBLE; @@ -1339,16 +1329,25 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) break; case kThingArmedRemoteBomb: if (pSprite->statnum != kStatRespawn) { + if (event.cmd != kCmdOn) actExplodeSprite(pSprite); + else { + sfxPlay3DSound(pSprite, 454, 0, 0); + evPost(nSprite, 3, 18, kCmdOff); + } + } + break; + + /*if (pSprite->statnum != kStatRespawn) { switch (event.cmd) { case kCmdOn: actExplodeSprite(pSprite); break; default: sfxPlay3DSound(pSprite, 454, 0, 0); - evPost(nSprite, 3, 18, kCmdOff, event.causedBy); + evPost(nSprite, 3, 18, kCmdOff); break; } - } + }*/ break; case kThingArmedProxBomb: @@ -1358,7 +1357,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kCmdSpriteProximity: if (pXSprite->state) break; sfxPlay3DSound(pSprite, 452, 0, 0); - evPost(nSprite, 3, 30, kCmdOff, event.causedBy); + evPost(nSprite, 3, 30, kCmdOff); pXSprite->state = 1; fallthrough__; case kCmdOn: @@ -1385,20 +1384,20 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kGenSound: switch (event.cmd) { case kCmdOff: - SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + SetSpriteState(nSprite, pXSprite, 0); break; case kCmdRepeat: if (pSprite->type != kGenTrigger) ActivateGenerator(nSprite); - if (pXSprite->txID) evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, event.causedBy); + if (pXSprite->txID) evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); if (pXSprite->busyTime > 0) { int nRand = Random2(pXSprite->data1); - evPost(nSprite, 3, 120*(nRand+pXSprite->busyTime) / 10, kCmdRepeat, event.causedBy); + evPost(nSprite, 3, 120*(nRand+pXSprite->busyTime) / 10, kCmdRepeat); } break; default: if (!pXSprite->state) { - SetSpriteState(nSprite, pXSprite, 1, event.causedBy); - evPost(nSprite, 3, 0, kCmdRepeat, event.causedBy); + SetSpriteState(nSprite, pXSprite, 1); + evPost(nSprite, 3, 0, kCmdRepeat); } break; } @@ -1414,15 +1413,15 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kThingZombieHead: switch (event.cmd) { case kCmdOff: - if (!SetSpriteState(nSprite, pXSprite, 0, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 0)) break; actActivateGibObject(pSprite, pXSprite); break; case kCmdOn: - if (!SetSpriteState(nSprite, pXSprite, 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, 1)) break; actActivateGibObject(pSprite, pXSprite); break; default: - if (!SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy)) break; + if (!SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1)) break; actActivateGibObject(pSprite, pXSprite); break; } @@ -1430,13 +1429,13 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) default: switch (event.cmd) { case kCmdOff: - SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + SetSpriteState(nSprite, pXSprite, 0); break; case kCmdOn: - SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, 1); break; default: - SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, pXSprite->state ^ 1); break; } break; @@ -1463,7 +1462,7 @@ void stopWindOnSectors(XSPRITE* pXSource) { } } -void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer, int causedBy) { +void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer) { int nSource = sprite[pXSource->reference].index; TRPLAYERCTRL* pCtrl = &gPlayerCtrl[pPlayer->nPlayer]; QAV* pQav = qavSceneLoad(pXSource->data2); @@ -1483,7 +1482,7 @@ void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer, int causedBy) { pCtrl->qavScene.index = nSource; pCtrl->qavScene.qavResrc = pQav; - pCtrl->qavScene.causedBy = causedBy; + pCtrl->qavScene.dummy = -1; pCtrl->qavScene.qavResrc->Preload(); @@ -1581,7 +1580,7 @@ void useObjResizer(XSPRITE* pXSource, short objType, int objIndex) { gGenDudeExtra[objIndex].updReq[kGenDudePropertyAttack] = true; gGenDudeExtra[objIndex].updReq[kGenDudePropertyMass] = true; gGenDudeExtra[objIndex].updReq[kGenDudePropertyDmgScale] = true; - evPost(objIndex, 3, kGenDudeUpdTimeRate, kCallbackGenDudeUpdate, -1); + evPost(objIndex, 3, kGenDudeUpdTimeRate, kCallbackGenDudeUpdate); break; } } @@ -2176,13 +2175,13 @@ void OperateWall(int nWall, XWALL *pXWall, EVENT event) { case kSwitchOneWay: switch (event.cmd) { case kCmdOff: - SetWallState(nWall, pXWall, 0, event.causedBy); + SetWallState(nWall, pXWall, 0); break; case kCmdOn: - SetWallState(nWall, pXWall, 1, event.causedBy); + SetWallState(nWall, pXWall, 1); break; default: - SetWallState(nWall, pXWall, pXWall->restState ^ 1, event.causedBy); + SetWallState(nWall, pXWall, pXWall->restState ^ 1); break; } return; @@ -2199,13 +2198,13 @@ void OperateWall(int nWall, XWALL *pXWall, EVENT event) { switch (event.cmd) { case kCmdOn: case kCmdWallImpact: - bStatus = SetWallState(nWall, pXWall, 1, event.causedBy); + bStatus = SetWallState(nWall, pXWall, 1); break; case kCmdOff: - bStatus = SetWallState(nWall, pXWall, 0, event.causedBy); + bStatus = SetWallState(nWall, pXWall, 0); break; default: - bStatus = SetWallState(nWall, pXWall, pXWall->state ^ 1, event.causedBy); + bStatus = SetWallState(nWall, pXWall, pXWall->state ^ 1); break; } @@ -2222,13 +2221,13 @@ void OperateWall(int nWall, XWALL *pXWall, EVENT event) { default: switch (event.cmd) { case kCmdOff: - SetWallState(nWall, pXWall, 0, event.causedBy); + SetWallState(nWall, pXWall, 0); break; case kCmdOn: - SetWallState(nWall, pXWall, 1, event.causedBy); + SetWallState(nWall, pXWall, 1); break; default: - SetWallState(nWall, pXWall, pXWall->state ^ 1, event.causedBy); + SetWallState(nWall, pXWall, pXWall->state ^ 1); break; } return; @@ -2546,7 +2545,7 @@ int GetCrushedSpriteExtents(unsigned int nSector, int *pzTop, int *pzBot) return vc; } -int VCrushBusy(unsigned int nSector, unsigned int a2, short causedBy) +int VCrushBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); int nXSector = sector[nSector].extra; @@ -2575,17 +2574,17 @@ int VCrushBusy(unsigned int nSector, unsigned int a2, short causedBy) sector[nSector].floorz = v10; pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) - evSend(nSector, 6, pXSector->txID, kCmdLink, causedBy); + evSend(nSector, 6, pXSector->txID, kCmdLink); if ((a2&0xffff) == 0) { - SetSectorState(nSector, pXSector, a2>>16, causedBy); + SetSectorState(nSector, pXSector, a2>>16); SectorEndSound(nSector, a2>>16); return 3; } return 0; } -int VSpriteBusy(unsigned int nSector, unsigned int a2, short causedBy) +int VSpriteBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); int nXSector = sector[nSector].extra; @@ -2624,17 +2623,17 @@ int VSpriteBusy(unsigned int nSector, unsigned int a2, short causedBy) } pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) - evSend(nSector, 6, pXSector->txID, kCmdLink, causedBy); + evSend(nSector, 6, pXSector->txID, kCmdLink); if ((a2&0xffff) == 0) { - SetSectorState(nSector, pXSector, a2>>16, causedBy); + SetSectorState(nSector, pXSector, a2>>16); SectorEndSound(nSector, a2>>16); return 3; } return 0; } -int VDoorBusy(unsigned int nSector, unsigned int a2, short causedBy) +int VDoorBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); int nXSector = sector[nSector].extra; @@ -2723,17 +2722,17 @@ int VDoorBusy(unsigned int nSector, unsigned int a2, short causedBy) ZTranslateSector(nSector, pXSector, a2, nWave); pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) - evSend(nSector, 6, pXSector->txID, kCmdLink, causedBy); + evSend(nSector, 6, pXSector->txID, kCmdLink); if ((a2&0xffff) == 0) { - SetSectorState(nSector, pXSector, a2>>16, causedBy); + SetSectorState(nSector, pXSector, a2>>16); SectorEndSound(nSector, a2>>16); return 3; } return 0; } -int HDoorBusy(unsigned int nSector, unsigned int a2, short causedBy) +int HDoorBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; @@ -2751,17 +2750,17 @@ int HDoorBusy(unsigned int nSector, unsigned int a2, short causedBy) ZTranslateSector(nSector, pXSector, a2, nWave); pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) - evSend(nSector, 6, pXSector->txID, kCmdLink, causedBy); + evSend(nSector, 6, pXSector->txID, kCmdLink); if ((a2&0xffff) == 0) { - SetSectorState(nSector, pXSector, a2>>16, causedBy); + SetSectorState(nSector, pXSector, a2>>16); SectorEndSound(nSector, a2>>16); return 3; } return 0; } -int RDoorBusy(unsigned int nSector, unsigned int a2, short causedBy) +int RDoorBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; @@ -2778,17 +2777,17 @@ int RDoorBusy(unsigned int nSector, unsigned int a2, short causedBy) ZTranslateSector(nSector, pXSector, a2, nWave); pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) - evSend(nSector, 6, pXSector->txID, kCmdLink, causedBy); + evSend(nSector, 6, pXSector->txID, kCmdLink); if ((a2&0xffff) == 0) { - SetSectorState(nSector, pXSector, a2>>16, causedBy); + SetSectorState(nSector, pXSector, a2>>16); SectorEndSound(nSector, a2>>16); return 3; } return 0; } -int StepRotateBusy(unsigned int nSector, unsigned int a2, short causedBy) +int StepRotateBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; @@ -2811,10 +2810,10 @@ int StepRotateBusy(unsigned int nSector, unsigned int a2, short causedBy) } pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) - evSend(nSector, 6, pXSector->txID, kCmdLink, causedBy); + evSend(nSector, 6, pXSector->txID, kCmdLink); if ((a2&0xffff) == 0) { - SetSectorState(nSector, pXSector, a2>>16, causedBy); + SetSectorState(nSector, pXSector, a2>>16); SectorEndSound(nSector, a2>>16); pXSector->data = vbp&2047; return 3; @@ -2822,7 +2821,7 @@ int StepRotateBusy(unsigned int nSector, unsigned int a2, short causedBy) return 0; } -int GenSectorBusy(unsigned int nSector, unsigned int a2, short causedBy) +int GenSectorBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; @@ -2831,17 +2830,17 @@ int GenSectorBusy(unsigned int nSector, unsigned int a2, short causedBy) XSECTOR *pXSector = &xsector[nXSector]; pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) - evSend(nSector, 6, pXSector->txID, kCmdLink, causedBy); + evSend(nSector, 6, pXSector->txID, kCmdLink); if ((a2&0xffff) == 0) { - SetSectorState(nSector, pXSector, a2>>16, causedBy); + SetSectorState(nSector, pXSector, a2>>16); SectorEndSound(nSector, a2>>16); return 3; } return 0; } -int PathBusy(unsigned int nSector, unsigned int a2, short causedBy) +int PathBusy(unsigned int nSector, unsigned int a2) { dassert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; @@ -2859,7 +2858,7 @@ int PathBusy(unsigned int nSector, unsigned int a2, short causedBy) pXSector->busy = a2; if ((a2&0xffff) == 0) { - evPost(nSector, 6, (120*pXSprite2->waitTime)/10, kCmdOn, causedBy); + evPost(nSector, 6, (120*pXSprite2->waitTime)/10, kCmdOn); pXSector->state = 0; pXSector->busy = 0; if (pXSprite1->data4) @@ -2990,7 +2989,7 @@ void OperatePath(unsigned int nSector, XSECTOR *pXSector, EVENT event) // by NoOne: trigger marker after it gets reached if (gModernMap && pXSprite2->state != 1) - trTriggerSprite(pSprite2->xvel, pXSprite2, kCmdOn, -1); + trTriggerSprite(pSprite2->xvel, pXSprite2, kCmdOn); if (nSprite < 0) { viewSetSystemMessage("Unable to find path marker with id #%d for path sector #%d", nId, nSector); @@ -3098,13 +3097,13 @@ void OperateSector(unsigned int nSector, XSECTOR *pXSector, EVENT event) switch (event.cmd) { case kCmdOff: - SetSectorState(nSector, pXSector, 0, event.causedBy); + SetSectorState(nSector, pXSector, 0); break; case kCmdOn: - SetSectorState(nSector, pXSector, 1, event.causedBy); + SetSectorState(nSector, pXSector, 1); break; default: - SetSectorState(nSector, pXSector, pXSector->state ^ 1, event.causedBy); + SetSectorState(nSector, pXSector, pXSector->state ^ 1); break; } @@ -3148,7 +3147,7 @@ void InitPath(unsigned int nSector, XSECTOR *pXSector) pXSector->marker0 = nSprite; basePath[nSector] = nSprite; if (pXSector->state) - evPost(nSector, 6, 0, kCmdOn, -1); + evPost(nSector, 6, 0, kCmdOn); } void LinkSector(int nSector, XSECTOR *pXSector, EVENT event) @@ -3157,18 +3156,18 @@ void LinkSector(int nSector, XSECTOR *pXSector, EVENT event) int nBusy = GetSourceBusy(event); switch (pSector->type) { case kSectorZMotionSprite: - VSpriteBusy(nSector, nBusy, event.causedBy); + VSpriteBusy(nSector, nBusy); break; case kSectorZMotion: - VDoorBusy(nSector, nBusy, event.causedBy); + VDoorBusy(nSector, nBusy); break; case kSectorSlideMarked: case kSectorSlide: - HDoorBusy(nSector, nBusy, event.causedBy); + HDoorBusy(nSector, nBusy); break; case kSectorRotateMarked: case kSectorRotate: - RDoorBusy(nSector, nBusy, event.causedBy); + RDoorBusy(nSector, nBusy); break; /* By NoOne: add link support for counter sectors so they can change necessary type and count of types*/ case kSectorCounter: @@ -3178,7 +3177,7 @@ void LinkSector(int nSector, XSECTOR *pXSector, EVENT event) default: pXSector->busy = nBusy; if ((pXSector->busy&0xffff) == 0) - SetSectorState(nSector, pXSector, nBusy>>16, event.causedBy); + SetSectorState(nSector, pXSector, nBusy>>16); break; } } @@ -3310,9 +3309,9 @@ void LinkSprite(int nSprite, XSPRITE *pXSprite, EVENT event) { dassert(nXSprite2 > 0 && nXSprite2 < kMaxXSprites); pXSprite->data1 = xsprite[nXSprite2].data1; if (pXSprite->data1 == pXSprite->data2) - SetSpriteState(nSprite, pXSprite, 1, event.causedBy); + SetSpriteState(nSprite, pXSprite, 1); else - SetSpriteState(nSprite, pXSprite, 0, event.causedBy); + SetSpriteState(nSprite, pXSprite, 0); } } break; @@ -3320,7 +3319,7 @@ void LinkSprite(int nSprite, XSPRITE *pXSprite, EVENT event) { { pXSprite->busy = nBusy; if ((pXSprite->busy & 0xffff) == 0) - SetSpriteState(nSprite, pXSprite, nBusy >> 16, event.causedBy); + SetSpriteState(nSprite, pXSprite, nBusy >> 16); } break; } @@ -3331,10 +3330,10 @@ void LinkWall(int nWall, XWALL *pXWall, EVENT event) int nBusy = GetSourceBusy(event); pXWall->busy = nBusy; if ((pXWall->busy & 0xffff) == 0) - SetWallState(nWall, pXWall, nBusy>>16, event.causedBy); + SetWallState(nWall, pXWall, nBusy>>16); } -void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command, short causedBy) { +void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command) { dassert(nSector < (unsigned int)numsectors); if (!pXSector->locked && !pXSector->isTriggered) { @@ -3342,12 +3341,11 @@ void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command, short pXSector->isTriggered = 1; if (pXSector->decoupled && pXSector->txID > 0) - evSend(nSector, 6, pXSector->txID, (COMMAND_ID)pXSector->command, causedBy); + evSend(nSector, 6, pXSector->txID, (COMMAND_ID)pXSector->command); else { EVENT event; event.cmd = command; - event.causedBy = causedBy; OperateSector(nSector, pXSector, event); } @@ -3373,7 +3371,7 @@ void trMessageSector(unsigned int nSector, EVENT event) { } } -void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command, short causedBy) { +void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command) { dassert(nWall < (unsigned int)numwalls); if (!pXWall->locked && !pXWall->isTriggered) { @@ -3381,12 +3379,11 @@ void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command, short causedB pXWall->isTriggered = 1; if (pXWall->decoupled && pXWall->txID > 0) - evSend(nWall, 0, pXWall->txID, (COMMAND_ID)pXWall->command, causedBy); + evSend(nWall, 0, pXWall->txID, (COMMAND_ID)pXWall->command); else { EVENT event; event.cmd = command; - event.causedBy = causedBy; OperateWall(nWall, pXWall, event); } @@ -3413,19 +3410,18 @@ void trMessageWall(unsigned int nWall, EVENT event) { } } -void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command, short causedBy) { +void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command) { if (!pXSprite->locked && !pXSprite->isTriggered) { if (pXSprite->triggerOnce) pXSprite->isTriggered = 1; if (pXSprite->Decoupled && pXSprite->txID > 0) - evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command, causedBy); + evSend(nSprite, 3, pXSprite->txID, (COMMAND_ID)pXSprite->command); else { EVENT event; event.cmd = command; - event.causedBy = causedBy; OperateSprite(nSprite, pXSprite, event); } @@ -3600,7 +3596,7 @@ void pastePropertiesInObj(int type, int nDest, EVENT event) { } } - setDataValueOfObject(type, nDest, pXSource->data1, data, event.causedBy); + setDataValueOfObject(type, nDest, pXSource->data1, data); return; @@ -3617,26 +3613,26 @@ void pastePropertiesInObj(int type, int nDest, EVENT event) { switch (type) { case 6: if ((pSource->flags & kModernTypeFlag1) || (pXSource->data1 != -1 && pXSource->data1 != 32767)) - setDataValueOfObject(type, nDest, 1, pXSource->data1, event.causedBy); + setDataValueOfObject(type, nDest, 1, pXSource->data1); break; case 3: if ((pSource->flags & kModernTypeFlag1) || (pXSource->data1 != -1 && pXSource->data1 != 32767)) - setDataValueOfObject(type, nDest, 1, pXSource->data1, event.causedBy); + setDataValueOfObject(type, nDest, 1, pXSource->data1); if ((pSource->flags & kModernTypeFlag1) || (pXSource->data2 != -1 && pXSource->data2 != 32767)) - setDataValueOfObject(type, nDest, 2, pXSource->data2, event.causedBy); + setDataValueOfObject(type, nDest, 2, pXSource->data2); if ((pSource->flags & kModernTypeFlag1) || (pXSource->data3 != -1 && pXSource->data3 != 32767)) - setDataValueOfObject(type, nDest, 3, pXSource->data3, event.causedBy); + setDataValueOfObject(type, nDest, 3, pXSource->data3); if ((pSource->flags & kModernTypeFlag1) || pXSource->data4 != 65535) - setDataValueOfObject(type, nDest, 4, pXSource->data4, event.causedBy); + setDataValueOfObject(type, nDest, 4, pXSource->data4); break; case 0: if ((pSource->flags & kModernTypeFlag1) || (pXSource->data1 != -1 && pXSource->data1 != 32767)) - setDataValueOfObject(type, nDest, 1, pXSource->data1, event.causedBy); + setDataValueOfObject(type, nDest, 1, pXSource->data1); break; } @@ -4223,7 +4219,7 @@ int getDataFieldOfObject(int objType, int objIndex, int dataIndex) { } } -bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value, int causedBy) { +bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value) { switch (objType) { case 3: { @@ -4246,14 +4242,14 @@ bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value, i xsprite[sprite[objIndex].extra].data1 = value; switch (sprite[objIndex].type) { case kSwitchCombo: - if (value == xsprite[sprite[objIndex].extra].data2) SetSpriteState(objIndex, &xsprite[sprite[objIndex].extra], 1, causedBy); - else SetSpriteState(objIndex, &xsprite[sprite[objIndex].extra], 0, causedBy); + if (value == xsprite[sprite[objIndex].extra].data2) SetSpriteState(objIndex, &xsprite[sprite[objIndex].extra], 1); + else SetSpriteState(objIndex, &xsprite[sprite[objIndex].extra], 0); break; case kDudeModernCustom: case kDudeModernCustomBurning: gGenDudeExtra[objIndex].updReq[kGenDudePropertyWeapon] = true; gGenDudeExtra[objIndex].updReq[kGenDudePropertyDmgScale] = true; - evPost(objIndex, 3, kGenDudeUpdTimeRate, kCallbackGenDudeUpdate, causedBy); + evPost(objIndex, 3, kGenDudeUpdTimeRate, kCallbackGenDudeUpdate); break; } return true; @@ -4267,7 +4263,7 @@ bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value, i gGenDudeExtra[objIndex].updReq[kGenDudePropertyDmgScale] = true; gGenDudeExtra[objIndex].updReq[kGenDudePropertyStates] = true; gGenDudeExtra[objIndex].updReq[kGenDudePropertyAttack] = true; - evPost(objIndex, 3, kGenDudeUpdTimeRate, kCallbackGenDudeUpdate, causedBy); + evPost(objIndex, 3, kGenDudeUpdTimeRate, kCallbackGenDudeUpdate); break; } return true; @@ -4552,7 +4548,7 @@ void AlignSlopes(void) } } -int(*gBusyProc[])(unsigned int, unsigned int, short) = +int(*gBusyProc[])(unsigned int, unsigned int) = { VCrushBusy, VSpriteBusy, @@ -4572,7 +4568,7 @@ void trProcessBusy(void) { int oldBusy = gBusy[i].at8; gBusy[i].at8 = ClipRange(oldBusy+gBusy[i].at4*4, 0, 65536); - int nStatus = gBusyProc[gBusy[i].atc](gBusy[i].at0, gBusy[i].at8, -1); + int nStatus = gBusyProc[gBusy[i].atc](gBusy[i].at0, gBusy[i].at8); switch (nStatus) { case 1: gBusy[i].at8 = oldBusy; @@ -4741,17 +4737,17 @@ void trInit(void) } } - evSend(0, 0, kChannelLevelStart, kCmdOn, -1); + evSend(0, 0, kChannelLevelStart, kCmdOn); switch (gGameOptions.nGameType) { case 1: - evSend(0, 0, kChannelLevelStartCoop, kCmdOn, -1); + evSend(0, 0, kChannelLevelStartCoop, kCmdOn); break; case 2: - evSend(0, 0, kChannelLevelStartMatch, kCmdOn, -1); + evSend(0, 0, kChannelLevelStartMatch, kCmdOn); break; case 3: - evSend(0, 0, kChannelLevelStartMatch, kCmdOn, -1); - evSend(0, 0, kChannelLevelStartTeamsOnly, kCmdOn, -1); + evSend(0, 0, kChannelLevelStartMatch, kCmdOn); + evSend(0, 0, kChannelLevelStartTeamsOnly, kCmdOn); break; } } @@ -4778,30 +4774,30 @@ void InitGenerator(int nSprite) pSprite->cstat &= ~CSTAT_SPRITE_BLOCK; pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; if (pXSprite->state != pXSprite->restState) - evPost(nSprite, 3, (120 * pXSprite->busyTime) / 10, kCmdRepeat, -1); + evPost(nSprite, 3, (120 * pXSprite->busyTime) / 10, kCmdRepeat); return; case kModernDudeTargetChanger: pSprite->cstat &= ~CSTAT_SPRITE_BLOCK; pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; if (pXSprite->busyTime <= 0) pXSprite->busyTime = 5; if (pXSprite->state != pXSprite->restState) - evPost(nSprite, 3, 0, kCmdRepeat, -1); + evPost(nSprite, 3, 0, kCmdRepeat); return; case kModernEffectSpawner: case kModernSeqSpawner: if (pXSprite->state != pXSprite->restState) - evPost(nSprite, 3, 0, kCmdRepeat, -1); + evPost(nSprite, 3, 0, kCmdRepeat); return; case kModernObjDataAccumulator: pSprite->cstat &= ~CSTAT_SPRITE_BLOCK; pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; if (pXSprite->state != pXSprite->restState) - evPost(nSprite, 3, 0, kCmdRepeat, -1); + evPost(nSprite, 3, 0, kCmdRepeat); return; case kModernWindGenerator: pSprite->cstat &= ~CSTAT_SPRITE_BLOCK; if (pXSprite->state != pXSprite->restState) - evPost(nSprite, 3, 0, kCmdRepeat, -1); + evPost(nSprite, 3, 0, kCmdRepeat); return; case kGenTrigger: pSprite->cstat &= ~CSTAT_SPRITE_BLOCK; @@ -4809,7 +4805,7 @@ void InitGenerator(int nSprite) break; } if (pXSprite->state != pXSprite->restState && pXSprite->busyTime > 0) - evPost(nSprite, 3, (120*(pXSprite->busyTime+Random2(pXSprite->data1)))/10, kCmdRepeat, -1); + evPost(nSprite, 3, (120*(pXSprite->busyTime+Random2(pXSprite->data1)))/10, kCmdRepeat); } void ActivateGenerator(int nSprite) @@ -4971,7 +4967,7 @@ void MGunFireSeqCallback(int, int nXSprite) { pXSprite->data2--; if (pXSprite->data2 == 0) - evPost(nSprite, 3, 1, kCmdOff, nSprite); + evPost(nSprite, 3, 1, kCmdOff); } int dx = (Cos(pSprite->ang)>>16)+Random2(1000); int dy = (Sin(pSprite->ang)>>16)+Random2(1000); diff --git a/source/blood/src/triggers.h b/source/blood/src/triggers.h index a82f1ad55..9a759e8d8 100644 --- a/source/blood/src/triggers.h +++ b/source/blood/src/triggers.h @@ -35,11 +35,11 @@ BEGIN_BLD_NS #define kPlayerCtrlSigStart "<<<>>>" // save game TRPLAYERCTRL block end -void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command, short causedBy); +void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command); void trMessageSector(unsigned int nSector, EVENT event); -void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command, short causedBy); +void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command); void trMessageWall(unsigned int nWall, EVENT event); -void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command, short causedBy); +void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command); void trMessageSprite(unsigned int nSprite, EVENT event); void trProcessBusy(void); void trInit(void); @@ -69,7 +69,7 @@ void freeTargets(int nSprite); void freeAllTargets(XSPRITE* pXSource); bool affectedByTargetChg(XSPRITE* pXDude); int getDataFieldOfObject(int objType, int objIndex, int dataIndex); -bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value, int causedBy); +bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value); bool goalValueIsReached(XSPRITE* pXSprite); bool getDudesForTargetChg(XSPRITE* pXSprite); void stopWindOnSectors(XSPRITE* pXSource); @@ -84,7 +84,7 @@ void TeleFrag(int nKiller, int nSector); bool valueIsBetween(int val, int min, int max); void trPlayerCtrlLink(XSPRITE* pXSource, PLAYER* pPlayer); -void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer, int causedBy); +void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer); void trPlayerCtrlStopScene(XSPRITE* pXSource, PLAYER* pPlayer); // ------------------------------------------------------- diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 45ebce1d8..0400b24ea 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -1005,7 +1005,7 @@ void ThrowCan(int, PLAYER *pPlayer) if (pSprite) { sfxPlay3DSound(pSprite, 441, 0, 0); - evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); int nXSprite = pSprite->extra; XSPRITE *pXSprite = &xsprite[nXSprite]; pXSprite->Impact = 1; @@ -1020,7 +1020,7 @@ void DropCan(int, PLAYER *pPlayer) spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0); if (pSprite) { - evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); UseAmmo(pPlayer, 6, gAmmoItemData[0].count); } } @@ -1029,7 +1029,7 @@ void ExplodeCan(int, PLAYER *pPlayer) { sfxKill3DSound(pPlayer->pSprite, -1, 441); spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0); - evPost(pSprite->index, 3, 0, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, 0, kCmdOn); UseAmmo(pPlayer, 6, gAmmoItemData[0].count); StartQAV(pPlayer, 15, -1); pPlayer->curWeapon = 0; @@ -1047,7 +1047,7 @@ void ThrowBundle(int, PLAYER *pPlayer) if (pPlayer->fuseTime < 0) pXSprite->Impact = 1; else - evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); UseAmmo(pPlayer, 5, 1); pPlayer->throwPower = 0; } @@ -1056,7 +1056,7 @@ void DropBundle(int, PLAYER *pPlayer) { sfxKill3DSound(pPlayer->pSprite, 16, -1); spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0); - evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); UseAmmo(pPlayer, 5, 1); } @@ -1064,7 +1064,7 @@ void ExplodeBundle(int, PLAYER *pPlayer) { sfxKill3DSound(pPlayer->pSprite, 16, -1); spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0); - evPost(pSprite->index, 3, 0, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, 0, kCmdOn); UseAmmo(pPlayer, 5, 1); StartQAV(pPlayer, 24, -1, 0); pPlayer->curWeapon = 0; @@ -1076,7 +1076,7 @@ void ThrowProx(int, PLAYER *pPlayer) int nSpeed = mulscale16(pPlayer->throwPower, 0x177777)+0x66666; sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0); spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedProxBomb, nSpeed); - evPost(pSprite->index, 3, 240, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, 240, kCmdOn); UseAmmo(pPlayer, 10, 1); pPlayer->throwPower = 0; } @@ -1084,7 +1084,7 @@ void ThrowProx(int, PLAYER *pPlayer) void DropProx(int, PLAYER *pPlayer) { spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedProxBomb, 0); - evPost(pSprite->index, 3, 240, kCmdOn, pPlayer->nSprite); + evPost(pSprite->index, 3, 240, kCmdOn); UseAmmo(pPlayer, 10, 1); } @@ -1111,7 +1111,7 @@ void DropRemote(int, PLAYER *pPlayer) void FireRemote(int, PLAYER *pPlayer) { - evSend(0, 0, 90+(pPlayer->pSprite->type-kDudePlayer1), kCmdOn, pPlayer->nSprite); + evSend(0, 0, 90+(pPlayer->pSprite->type-kDudePlayer1), kCmdOn); } #define kMaxShotgunBarrels 4 @@ -1946,9 +1946,9 @@ void WeaponProcess(PLAYER *pPlayer) { XSPRITE* pXSprite = &xsprite[sprite[nIndex].extra]; if (pXSprite->waitTime > 0 && --pXSprite->sysData1 <= 0) { if (pXSprite->txID > 0) - evSend(nIndex, 3, pXSprite->txID, (COMMAND_ID) pXSprite->command, pQavScene->causedBy); + evSend(nIndex, 3, pXSprite->txID, (COMMAND_ID) pXSprite->command); if (pXSprite->locked) trPlayerCtrlStopScene(pXSprite, pPlayer); - else evPost(nIndex, 3, 0, (COMMAND_ID) (kCmdNumberic + 4), pQavScene->causedBy); + else evPost(nIndex, 3, 0, (COMMAND_ID) (kCmdNumberic + 4)); } else { qavScenePlay(pPlayer); pPlayer->weaponTimer = ClipLow(pPlayer->weaponTimer -= 4, 0);