- moved all 'sectorptr - &level.sectors[0]' constructs into a subfunction.

This commit is contained in:
Christoph Oelckers 2017-01-07 20:02:25 +01:00
commit 91981e25a8
13 changed files with 23 additions and 30 deletions

View file

@ -350,7 +350,7 @@ void P_RunEffects ()
{
if (players[consoleplayer].camera == NULL) return;
int pnum = int(players[consoleplayer].camera->Sector - &level.sectors[0]) * level.sectors.Size();
int pnum = players[consoleplayer].camera->Sector->Index() * level.sectors.Size();
AActor *actor;
TThinkerIterator<AActor> iterator;
@ -360,7 +360,7 @@ void P_RunEffects ()
if (actor->effects)
{
// Only run the effect if the actor is potentially visible
int rnum = pnum + int(actor->Sector - &level.sectors[0]);
int rnum = pnum + actor->Sector->Index();
if (rejectmatrix == NULL || !(rejectmatrix[rnum>>3] & (1 << (rnum & 7))))
P_RunEffect (actor, actor->effects);
}