Skip to content

Commit

Permalink
libdoom64: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Oct 22, 2013
1 parent f9d9536 commit d474f5c
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions doomsday/plugins/doom64/src/p_telept.c
Expand Up @@ -362,31 +362,31 @@ typedef struct {

int PIT_ChangeMobjFlags(thinker_t *th, void *context)
{
pit_changemobjflagsparams_t *params = (pit_changemobjflagsparams_t *) context;
pit_changemobjflagsparams_t *parm = (pit_changemobjflagsparams_t *) context;
mobj_t *mo = (mobj_t *) th;

if(params->sec && params->sec != Mobj_Sector(mo))
return false; // Continue iteration.
if(parm->sec && parm->sec != Mobj_Sector(mo))
return false;

if(params->notPlayers && mo->player)
return false; // Continue iteration.
if(parm->notPlayers && mo->player)
return false;

switch(params->op)
switch(parm->op)
{
case BW_CLEAR:
mo->flags &= ~params->flags;
mo->flags &= ~parm->flags;
break;

case BW_SET:
mo->flags |= params->flags;
mo->flags |= parm->flags;
break;

case BW_XOR:
mo->flags ^= params->flags;
mo->flags ^= parm->flags;
break;

default:
Con_Error("PIT_ChangeMobjFlags: Unknown flag bit op %i\n", params->op);
DENG_ASSERT(false);
break;
}

Expand All @@ -398,28 +398,31 @@ int PIT_ChangeMobjFlags(thinker_t *th, void *context)
* kaiser - removes things in tagged sector!
* DJS - actually, no it doesn't at least not directly.
*
* @todo: It appears the MF_TELEPORT flag has been hijacked.
* @todo fixme: It appears the MF_TELEPORT flag has been hijacked.
*/
int EV_FadeAway(Line* line, mobj_t* thing)
int EV_FadeAway(Line *line, mobj_t *thing)
{
Sector* sec = NULL;
iterlist_t* list;
iterlist_t *list;

list = P_GetSectorIterListForTag(P_ToXLine(line)->tag, false);
if(list)
DENG_UNUSED(thing);

if(!line) return 0;

if((list = P_GetSectorIterListForTag(P_ToXLine(line)->tag, false)) != 0)
{
pit_changemobjflagsparams_t params;
Sector *sec = 0;
pit_changemobjflagsparams_t parm;

params.flags = MF_TELEPORT;
params.op = BW_SET;
params.notPlayers = true;
parm.flags = MF_TELEPORT;
parm.op = BW_SET;
parm.notPlayers = true;

IterList_SetIteratorDirection(list, ITERLIST_FORWARD);
IterList_RewindIterator(list);
while((sec = IterList_MoveIterator(list)) != NULL)
{
params.sec = sec;
Thinker_Iterate(P_MobjThinker, PIT_ChangeMobjFlags, &params);
parm.sec = sec;
Thinker_Iterate(P_MobjThinker, PIT_ChangeMobjFlags, &parm);
}
}

Expand Down

0 comments on commit d474f5c

Please sign in to comment.