mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 19:21:44 +00:00
- removed pX... parameter from from trTriggerSector.
This commit is contained in:
parent
ccd6af6272
commit
f06697ed29
7 changed files with 21 additions and 19 deletions
|
@ -4907,7 +4907,7 @@ void MoveDude(DBloodActor* actor)
|
||||||
XSECTOR* pHitXSector = pHitSector->hasX()? &pHitSector->xs() : nullptr;
|
XSECTOR* pHitXSector = pHitSector->hasX()? &pHitSector->xs() : nullptr;
|
||||||
|
|
||||||
if (pDudeInfo->lockOut && pHitXSector && pHitXSector->Wallpush && !pHitXSector->Key && !pHitXSector->dudeLockout && !pHitXSector->state && !pHitXSector->busy && !pPlayer)
|
if (pDudeInfo->lockOut && pHitXSector && pHitXSector->Wallpush && !pHitXSector->Key && !pHitXSector->dudeLockout && !pHitXSector->state && !pHitXSector->busy && !pPlayer)
|
||||||
trTriggerSector(pHitWall->nextsector, pHitXSector, kCmdSectorPush);
|
trTriggerSector(pHitSector, kCmdSectorPush);
|
||||||
|
|
||||||
if (top < pHitSector->ceilingz || bottom > pHitSector->floorz)
|
if (top < pHitSector->ceilingz || bottom > pHitSector->floorz)
|
||||||
{
|
{
|
||||||
|
@ -4935,14 +4935,14 @@ void MoveDude(DBloodActor* actor)
|
||||||
XSECTOR* pXOldSector = pOldSector->hasX()? &pOldSector->xs() : nullptr;
|
XSECTOR* pXOldSector = pOldSector->hasX()? &pOldSector->xs() : nullptr;
|
||||||
|
|
||||||
if (pXOldSector && pXOldSector->Exit && (pPlayer || !pXOldSector->dudeLockout))
|
if (pXOldSector && pXOldSector->Exit && (pPlayer || !pXOldSector->dudeLockout))
|
||||||
trTriggerSector(pSprite->sectnum, pXOldSector, kCmdSectorExit);
|
trTriggerSector(pOldSector, kCmdSectorExit);
|
||||||
ChangeActorSect(actor, nSector);
|
ChangeActorSect(actor, nSector);
|
||||||
|
|
||||||
if (pXSector && pXSector->Enter && (pPlayer || !pXSector->dudeLockout))
|
if (pXSector && pXSector->Enter && (pPlayer || !pXSector->dudeLockout))
|
||||||
{
|
{
|
||||||
if (pSector->type == kSectorTeleport)
|
if (pSector->type == kSectorTeleport)
|
||||||
pXSector->actordata = actor;
|
pXSector->actordata = actor;
|
||||||
trTriggerSector(nSector, pXSector, kCmdSectorEnter);
|
trTriggerSector(pSector, kCmdSectorEnter);
|
||||||
}
|
}
|
||||||
|
|
||||||
nSector = pSprite->sectnum;
|
nSector = pSprite->sectnum;
|
||||||
|
|
|
@ -351,11 +351,14 @@ void EnemyBubble(DBloodActor* actor, int) // 11
|
||||||
void CounterCheck(DBloodActor*, int nSector) // 12
|
void CounterCheck(DBloodActor*, int nSector) // 12
|
||||||
{
|
{
|
||||||
if (!validSectorIndex(nSector)) return;
|
if (!validSectorIndex(nSector)) return;
|
||||||
if (sector[nSector].type != kSectorCounter) return;
|
auto pSector = §or[nSector];
|
||||||
if (sector[nSector].extra <= 0) return;
|
if (pSector->type != kSectorCounter) return;
|
||||||
|
if (pSector->extra <= 0) return;
|
||||||
|
|
||||||
XSECTOR *pXSector = &xsector[sector[nSector].extra];
|
XSECTOR *pXSector = &xsector[pSector->extra];
|
||||||
int nReq = pXSector->waitTimeA; int nType = pXSector->data; int nCount = 0;
|
int nReq = pXSector->waitTimeA;
|
||||||
|
int nType = pXSector->data;
|
||||||
|
int nCount = 0;
|
||||||
if (!nType || !nReq) return;
|
if (!nType || !nReq) return;
|
||||||
|
|
||||||
BloodSectIterator it(nSector);
|
BloodSectIterator it(nSector);
|
||||||
|
@ -369,7 +372,7 @@ void CounterCheck(DBloodActor*, int nSector) // 12
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
//pXSector->waitTimeA = 0; //do not reset necessary objects counter to zero
|
//pXSector->waitTimeA = 0; //do not reset necessary objects counter to zero
|
||||||
trTriggerSector(nSector, pXSector, kCmdOn);
|
trTriggerSector(pSector, kCmdOn);
|
||||||
pXSector->locked = 1; //lock sector, so it can be opened again later
|
pXSector->locked = 1; //lock sector, so it can be opened again later
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ static std::multiset<EVENT> queue;
|
||||||
|
|
||||||
static int GetBucketChannel(const RXBUCKET* pBucket)
|
static int GetBucketChannel(const RXBUCKET* pBucket)
|
||||||
{
|
{
|
||||||
int nXIndex;
|
|
||||||
switch (pBucket->type)
|
switch (pBucket->type)
|
||||||
{
|
{
|
||||||
case SS_SECTOR:
|
case SS_SECTOR:
|
||||||
|
|
|
@ -457,8 +457,7 @@ void nnExtTriggerObject(int objType, int objIndex, DBloodActor* objActor, int co
|
||||||
switch (objType)
|
switch (objType)
|
||||||
{
|
{
|
||||||
case OBJ_SECTOR:
|
case OBJ_SECTOR:
|
||||||
if (!xsectRangeIsFine(sector[objIndex].extra)) break;
|
trTriggerSector(§or[objIndex], command);
|
||||||
trTriggerSector(objIndex, &xsector[sector[objIndex].extra], command);
|
|
||||||
break;
|
break;
|
||||||
case OBJ_WALL:
|
case OBJ_WALL:
|
||||||
trTriggerWall(&wall[objIndex], command);
|
trTriggerWall(&wall[objIndex], command);
|
||||||
|
@ -3038,7 +3037,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pXSector->Enter && (pPlayer || (isDude && !pXSector->dudeLockout)))
|
if (pXSector->Enter && (pPlayer || (isDude && !pXSector->dudeLockout)))
|
||||||
trTriggerSector(pSource->sectnum, pXSector, kCmdSectorEnter);
|
trTriggerSector(pSource->sector(), kCmdSectorEnter);
|
||||||
|
|
||||||
if (pXSector->Underwater)
|
if (pXSector->Underwater)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1518,7 +1518,7 @@ void ProcessInput(PLAYER *pPlayer)
|
||||||
sndStartSample(snd, 255, 2, 0);
|
sndStartSample(snd, 255, 2, 0);
|
||||||
}
|
}
|
||||||
if (!key || pPlayer->hasKey[key])
|
if (!key || pPlayer->hasKey[key])
|
||||||
trTriggerSector(a2, pXSector, kCmdSpritePush);
|
trTriggerSector(§or[a2], kCmdSpritePush);
|
||||||
else if (pPlayer == gMe)
|
else if (pPlayer == gMe)
|
||||||
{
|
{
|
||||||
viewSetMessage(GStrings("TXTB_KEY"));
|
viewSetMessage(GStrings("TXTB_KEY"));
|
||||||
|
@ -2050,7 +2050,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
||||||
{
|
{
|
||||||
powerupClear(pPlayer);
|
powerupClear(pPlayer);
|
||||||
if (nXSector > 0 && xsector[nXSector].Exit)
|
if (nXSector > 0 && xsector[nXSector].Exit)
|
||||||
trTriggerSector(pSprite->sectnum, &xsector[nXSector], kCmdSectorExit);
|
trTriggerSector(pSprite->sector(), kCmdSectorExit);
|
||||||
pSprite->flags |= 7;
|
pSprite->flags |= 7;
|
||||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||||
{
|
{
|
||||||
|
|
|
@ -1717,20 +1717,21 @@ void LinkWall(int nWall, XWALL *pXWall, EVENT event)
|
||||||
SetWallState(nWall, pXWall, FixedToInt(nBusy));
|
SetWallState(nWall, pXWall, FixedToInt(nBusy));
|
||||||
}
|
}
|
||||||
|
|
||||||
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command) {
|
void trTriggerSector(sectortype* pSector, int command)
|
||||||
assert(nSector < (unsigned int)numsectors);
|
{
|
||||||
|
auto pXSector = &pSector->xs();
|
||||||
if (!pXSector->locked && !pXSector->isTriggered) {
|
if (!pXSector->locked && !pXSector->isTriggered) {
|
||||||
|
|
||||||
if (pXSector->triggerOnce)
|
if (pXSector->triggerOnce)
|
||||||
pXSector->isTriggered = 1;
|
pXSector->isTriggered = 1;
|
||||||
|
|
||||||
if (pXSector->decoupled && pXSector->txID > 0)
|
if (pXSector->decoupled && pXSector->txID > 0)
|
||||||
evSendSector(nSector,pXSector->txID, (COMMAND_ID)pXSector->command);
|
evSendSector(sectnum(pSector),pXSector->txID, (COMMAND_ID)pXSector->command);
|
||||||
|
|
||||||
else {
|
else {
|
||||||
EVENT event;
|
EVENT event;
|
||||||
event.cmd = command;
|
event.cmd = command;
|
||||||
OperateSector(nSector, pXSector, event);
|
OperateSector(sectnum(pSector), pXSector, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ struct BUSY {
|
||||||
extern BUSY gBusy[kMaxBusyCount];
|
extern BUSY gBusy[kMaxBusyCount];
|
||||||
extern int gBusyCount;
|
extern int gBusyCount;
|
||||||
|
|
||||||
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command);
|
void trTriggerSector(sectortype *pSector, int command);
|
||||||
void trMessageSector(unsigned int nSector, EVENT event);
|
void trMessageSector(unsigned int nSector, EVENT event);
|
||||||
void trTriggerWall(walltype*, int command);
|
void trTriggerWall(walltype*, int command);
|
||||||
void trMessageWall(unsigned int nWall, EVENT event);
|
void trMessageWall(unsigned int nWall, EVENT event);
|
||||||
|
|
Loading…
Reference in a new issue