some cleanup
This commit is contained in:
1 parent
5c82e674cc
commit
67eb7bbff8
5 files changed
+55
-76
No files matched your search
+17
-9
@@ -915,7 +915,7 @@ static void P_PlayerFlip(mobj_t *mo)
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (!(mo->player-players == displayplayers[i]))
|
||||
if (mo->player-players != displayplayers[i])
|
||||
continue;
|
||||
|
||||
localaiming[i] = mo->player->aiming;
|
||||
@@ -1236,7 +1236,7 @@ static void P_PushableCheckBustables(mobj_t *mo)
|
||||
if (!node->m_sector)
|
||||
break;
|
||||
|
||||
if (!(node->m_sector->ffloors))
|
||||
if (!node->m_sector->ffloors)
|
||||
continue;
|
||||
|
||||
ffloor_t *rover;
|
||||
@@ -3275,7 +3275,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||
{
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (!(player == &players[displayplayers[i]]))
|
||||
if (player != &players[displayplayers[i]])
|
||||
continue;
|
||||
|
||||
postimgtype[i] = postimg;
|
||||
@@ -5396,7 +5396,7 @@ mobj_t *P_GetClosestAxis(mobj_t *source)
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
|
||||
if (!(mo2->type == MT_AXIS))
|
||||
if (mo2->type != MT_AXIS)
|
||||
continue;
|
||||
|
||||
if (closestaxis == NULL)
|
||||
@@ -7209,11 +7209,17 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
P_SetTarget(&mobj->target, NULL);
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!(playeringame[i] && players[i].mo
|
||||
&& players[i].mare == mobj->threshold && players[i].health > 1))
|
||||
if (!playeringame[i] || !players[i].mo)
|
||||
continue;
|
||||
|
||||
if (players[i].mare != mobj->threshold)
|
||||
continue;
|
||||
|
||||
if (!(players[i].health > 1))
|
||||
continue;
|
||||
|
||||
fixed_t dist = P_AproxDistance(players[i].mo->x - mobj->x, players[i].mo->y - mobj->y);
|
||||
|
||||
if (!(dist < shortest))
|
||||
continue;
|
||||
|
||||
@@ -10354,7 +10360,7 @@ void P_PrecipitationEffects(void)
|
||||
for (y = yl; y >= yl && y <= yh; y += FRACUNIT*64)
|
||||
for (x = xl; x >= xl && x <= xh; x += FRACUNIT*64)
|
||||
{
|
||||
if (!(R_PointInSubsector(x, y)->sector->ceilingpic == skyflatnum)) // Found the outdoors!
|
||||
if (R_PointInSubsector(x, y)->sector->ceilingpic != skyflatnum) // Found the outdoors!
|
||||
continue;
|
||||
|
||||
newdist = S_CalculateSoundDistance(players[displayplayers[0]].mo->x, players[displayplayers[0]].mo->y, 0, x, y, 0);
|
||||
@@ -10704,8 +10710,10 @@ void P_AfterPlayerSpawn(INT32 playernum)
|
||||
if (!camera[i].chase)
|
||||
continue;
|
||||
|
||||
if (displayplayers[i] == playernum)
|
||||
P_ResetCamera(p, &camera[i]);
|
||||
if (displayplayers[i] != playernum)
|
||||
continue;
|
||||
|
||||
P_ResetCamera(p, &camera[i]);
|
||||
}
|
||||
|
||||
if (CheckForReverseGravity)
|
||||
|
||||
+18
-52
@@ -1553,28 +1553,27 @@ void Polyobj_InitLevel(void)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj_t *mo = (mobj_t *)th;
|
||||
|
||||
if (mo->info->doomednum == POLYOBJ_SPAWN_DOOMEDNUM ||
|
||||
mo->info->doomednum == POLYOBJ_SPAWNCRUSH_DOOMEDNUM)
|
||||
{
|
||||
mobj_t *mo = (mobj_t *)th;
|
||||
++numPolyObjects;
|
||||
|
||||
if (mo->info->doomednum == POLYOBJ_SPAWN_DOOMEDNUM ||
|
||||
mo->info->doomednum == POLYOBJ_SPAWNCRUSH_DOOMEDNUM)
|
||||
{
|
||||
++numPolyObjects;
|
||||
qitem = malloc(sizeof(mobjqitem_t));
|
||||
memset(qitem, 0, sizeof(mobjqitem_t));
|
||||
qitem->mo = mo;
|
||||
M_QueueInsert(&(qitem->mqitem), &spawnqueue);
|
||||
}
|
||||
else if (mo->info->doomednum == POLYOBJ_ANCHOR_DOOMEDNUM)
|
||||
{
|
||||
++numAnchors;
|
||||
|
||||
qitem = malloc(sizeof(mobjqitem_t));
|
||||
memset(qitem, 0, sizeof(mobjqitem_t));
|
||||
qitem->mo = mo;
|
||||
M_QueueInsert(&(qitem->mqitem), &spawnqueue);
|
||||
}
|
||||
else if (mo->info->doomednum == POLYOBJ_ANCHOR_DOOMEDNUM)
|
||||
{
|
||||
++numAnchors;
|
||||
|
||||
qitem = malloc(sizeof(mobjqitem_t));
|
||||
memset(qitem, 0, sizeof(mobjqitem_t));
|
||||
qitem->mo = mo;
|
||||
M_QueueInsert(&(qitem->mqitem), &anchorqueue);
|
||||
}
|
||||
qitem = malloc(sizeof(mobjqitem_t));
|
||||
memset(qitem, 0, sizeof(mobjqitem_t));
|
||||
qitem->mo = mo;
|
||||
M_QueueInsert(&(qitem->mqitem), &anchorqueue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1615,39 +1614,6 @@ void Polyobj_InitLevel(void)
|
||||
Polyobj_linkToBlockmap(&PolyObjects[i]);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// haleyjd 02/22/06: temporary debug
|
||||
printf("DEBUG: numPolyObjects = %d\n", numPolyObjects);
|
||||
for (i = 0; i < numPolyObjects; ++i)
|
||||
{
|
||||
INT32 j;
|
||||
polyobj_t *po = &PolyObjects[i];
|
||||
|
||||
printf("polyobj %d:\n", i);
|
||||
printf("id = %d, first = %d, next = %d\n", po->id, po->first, po->next);
|
||||
printf("segCount = %d, numSegsAlloc = %d\n", po->segCount, po->numSegsAlloc);
|
||||
for (j = 0; j < po->segCount; ++j)
|
||||
printf("\tseg %d: %p\n", j, po->segs[j]);
|
||||
printf("numVertices = %d, numVerticesAlloc = %d\n", po->numVertices, po->numVerticesAlloc);
|
||||
for (j = 0; j < po->numVertices; ++j)
|
||||
{
|
||||
printf("\tvtx %d: (%d, %d) / orig: (%d, %d)\n",
|
||||
j, po->vertices[j]->x>>FRACBITS, po->vertices[j]->y>>FRACBITS,
|
||||
po->origVerts[j].x>>FRACBITS, po->origVerts[j].y>>FRACBITS);
|
||||
}
|
||||
printf("numLines = %d, numLinesAlloc = %d\n", po->numLines, po->numLinesAlloc);
|
||||
for (j = 0; j < po->numLines; ++j)
|
||||
printf("\tline %d: %p\n", j, po->lines[j]);
|
||||
printf("spawnSpot = (%d, %d)\n", po->spawnSpot.x >> FRACBITS, po->spawnSpot.y >> FRACBITS);
|
||||
printf("centerPt = (%d, %d)\n", po->centerPt.x >> FRACBITS, po->centerPt.y >> FRACBITS);
|
||||
printf("attached = %d, linked = %d, validcount = %d, isBad = %d\n",
|
||||
po->attached, po->linked, po->validcount, po->isBad);
|
||||
printf("blockbox: [%d, %d, %d, %d]\n",
|
||||
po->blockbox[BOXLEFT], po->blockbox[BOXRIGHT], po->blockbox[BOXBOTTOM],
|
||||
po->blockbox[BOXTOP]);
|
||||
}
|
||||
#endif
|
||||
|
||||
// done with mobj queues
|
||||
M_QueueFree(&spawnqueue);
|
||||
M_QueueFree(&anchorqueue);
|
||||
|
||||
+7
-3
@@ -1905,6 +1905,7 @@ mobj_t *P_FindNewPosition(UINT32 oldposition)
|
||||
continue;
|
||||
|
||||
mobj = (mobj_t *)th;
|
||||
|
||||
if (mobj->mobjnum != oldposition)
|
||||
continue;
|
||||
|
||||
@@ -2913,10 +2914,9 @@ static void P_NetUnArchiveThinkers(void)
|
||||
continue;
|
||||
|
||||
delay = (void *)currentthinker;
|
||||
if (!(mobjnum = (UINT32)(size_t)delay->caller))
|
||||
continue;
|
||||
|
||||
delay->caller = P_FindNewPosition(mobjnum);
|
||||
if ((mobjnum = (UINT32)(size_t)delay->caller))
|
||||
delay->caller = P_FindNewPosition(mobjnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3027,6 +3027,7 @@ static inline void P_FinishMobjs(void)
|
||||
{
|
||||
if (currentthinker->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj = (mobj_t *)currentthinker;
|
||||
mobj->info = &mobjinfo[mobj->type];
|
||||
}
|
||||
@@ -3504,9 +3505,12 @@ void P_SaveNetGame(boolean resending)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj = (mobj_t *)th;
|
||||
|
||||
if (mobj->type == MT_HOOP || mobj->type == MT_HOOPCOLLIDE || mobj->type == MT_HOOPCENTER)
|
||||
continue;
|
||||
|
||||
mobj->mobjnum = i++;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -3052,11 +3052,9 @@ boolean P_IsFlagAtBase(mobjtype_t flag)
|
||||
if (GETSECSPECIAL(rover->master->frontsector->special, 4) != specialnum)
|
||||
continue;
|
||||
|
||||
if (!(mo->z <= P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector)
|
||||
&& mo->z >= P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector)))
|
||||
continue;
|
||||
|
||||
return true;
|
||||
if (mo->z <= P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector)
|
||||
&& mo->z >= P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-7
@@ -266,7 +266,10 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (!(viewplayer == &players[displayplayers[i]] && camera[i].chase))
|
||||
if (viewplayer != &players[displayplayers[i]])
|
||||
continue;
|
||||
|
||||
if (!camera[i].chase)
|
||||
continue;
|
||||
|
||||
heightsec = R_PointInSubsector(camera[i].x, camera[i].y)->sector->heightsec;
|
||||
@@ -1182,13 +1185,13 @@ void R_Prep3DFloors(sector_t *sector)
|
||||
count = 1;
|
||||
for (rover = sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!((rover->flags & FF_EXISTS) && (!(rover->flags & FF_NOSHADE)
|
||||
|| (rover->flags & FF_CUTLEVEL) || (rover->flags & FF_CUTSPRITES))))
|
||||
continue;
|
||||
|
||||
count++;
|
||||
if (rover->flags & FF_DOUBLESHADOW)
|
||||
if ((rover->flags & FF_EXISTS) && (!(rover->flags & FF_NOSHADE)
|
||||
|| (rover->flags & FF_CUTLEVEL) || (rover->flags & FF_CUTSPRITES)))
|
||||
{
|
||||
count++;
|
||||
if (rover->flags & FF_DOUBLESHADOW)
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count != sector->numlights)
|
||||
|
||||
Reference in new issue
Block a user