void P_RunMobjs(void) { for(currentmobj = mobjhead.next; currentmobj != &mobjhead; currentmobj = currentmobj->next) { if(!currentmobj) { CON_Warnf("P_RunMobjs: Null mobj in linked list!\n"); break; } // Special case only if(currentmobj->flags & MF_NOSECTOR) { continue; } if(gameflags & GF_LOCKMONSTERS && !currentmobj->player && currentmobj->flags & MF_COUNTKILL) { continue; } if(!currentmobj->player) { // [kex] don't bother if about to be removed if(currentmobj->mobjfunc != P_SafeRemoveMobj) { // [kex] don't clear callback if mobj is going to be respawning if(currentmobj->mobjfunc != P_RespawnSpecials) { currentmobj->mobjfunc = NULL; } P_MobjThinker(currentmobj); } if(currentmobj->mobjfunc) { currentmobj->mobjfunc(currentmobj); } } } }
void G_ShowBinding(char *key) { alist_t **alist; alist = G_FindKeyByName(key); if(!alist) { CON_Warnf("Unknown key:%s\n", key); return; } if(!*alist) { CON_Warnf("%s is not bound\n", key); return; } I_Printf("%s = ", key); G_PrintActions(*alist); I_Printf("\n"); }
void G_BindAction(alist_t **plist, char *action) { alist_t *al; al = ParseActions(action); if(plist) { if(*plist) DerefActionList(*plist); *plist = al; } else { CON_Warnf("Unknown Key\n"); DerefActionList(al); } }
void AddActions(alist_t *actions) { int slot; if(!actions) return; for(slot = 0; slot < MAX_CURRENTACTIONS; slot++) { if(!CurrentActions[slot]) { CurrentActions[slot] = DuplicateActionList(actions); break; } } if(slot == MAX_CURRENTACTIONS) CON_Warnf("command overflow\n"); }
alist_t *DoRunActions(alist_t *al, dboolean free) { alist_t *next = NULL; action_t *action; cvar_t *cvar; while(al) { next = al->next; if(dstrcmp(al->cmd, "wait") == 0) break; action = FindAction(al->cmd); if(action) { action->proc(action->data, al->param); } else if(cvar = CON_CvarGet(al->cmd)) { if(netgame) { if(cvar->nonclient) { // I'll just have to assume for now that // player# 0 is the server.. if(consoleplayer != 0) { CON_Warnf("Cannot change cvar that's locked by server\n"); goto next; } } } if(!al->param[0]) { char str[256]; sprintf(str, "%s: %s (%s)", cvar->name, cvar->string, cvar->defvalue); CON_AddLine(str, dstrlen(str)); } else { CON_CvarSet(cvar->name, al->param[0]); if(netgame) { if(playeringame[0] && consoleplayer == 0) NET_SV_UpdateCvars(cvar); } } } else CON_Warnf("Unknown command \"%s\"\n", al->cmd); next: if(free) DerefSingleAction(al); al = next; } if(al) // reached wait command { if(free) DerefSingleAction(al); if(next != NULL) return next; } return al; }
static void P_UpdateFrameStates(void) { player_t *player = &players[displayplayer]; pspdef_t *psp; mobj_t *viewcamera; angle_t pitch; mobj_t *mobj; int i; viewcamera = player->cameratarget; pitch = viewcamera->pitch + ANG90; if(viewcamera == player->mo) { pitch += player->recoilpitch; } // // update player position/view for interpolation // frame_viewx = player->cameratarget->x; frame_viewy = player->cameratarget->y; frame_viewz = (viewcamera == player->mo ? player->viewz : viewcamera->z) + quakeviewy; frame_angle = (player->cameratarget->angle + quakeviewx) + viewangleoffset; frame_pitch = pitch; // // update player sprites for interpolation // psp = &player->psprites[ps_weapon]; player->psprites[ps_weapon].frame_x = psp->sx; player->psprites[ps_weapon].frame_y = psp->sy; player->psprites[ps_flash].frame_x = psp->sx; player->psprites[ps_flash].frame_y = psp->sy; // // update sector frames for interpolation // for(i = 0; i < numsectors; i++) { sector_t* sector = §ors[i]; sector->frame_z1[0] = sector->floorheight; sector->frame_z2[0] = sector->ceilingheight; sector->frame_z1[1] = sector->frame_z1[0]; sector->frame_z2[1] = sector->frame_z1[0]; } // // update mobj frames for interpolation // for(mobj = mobjhead.next; mobj != &mobjhead; mobj = mobj->next) { if(!mobj) { CON_Warnf("P_UpdateFrameStates: Null mobj in linked list!\n"); continue; } // Special case only if(mobj->flags & MF_NOSECTOR) { continue; } mobj->frame_x = mobj->x; mobj->frame_y = mobj->y; mobj->frame_z = mobj->z; } }