// // haleyjd 07/25/03: temporary hack to resolve weapon states // until EDF weapon support is in place // WEAPON_FIXME // void D_InitWeaponInfo(void) { int i; for(i = 0; i < NUMWEAPONS; ++i) { weaponinfo[i].atkstate = E_SafeState(weaponinfo[i].atkstate); weaponinfo[i].downstate = E_SafeState(weaponinfo[i].downstate); weaponinfo[i].flashstate = E_SafeState(weaponinfo[i].flashstate); weaponinfo[i].readystate = E_SafeState(weaponinfo[i].readystate); weaponinfo[i].upstate = E_SafeState(weaponinfo[i].upstate); } // haleyjd 11/28/08: SSG enable if(GameModeInfo->type == Game_DOOM && W_CheckNumForNameNS("SHT2A0", lumpinfo_t::ns_sprites) > 0) enable_ssg = true; }
// // E_SafeStateNameOrLabel // // haleyjd 07/19/14: Allows lookup of what may either be an EDF global state // name, DECORATE state label relative to a particular mobjinfo, or a state // DeHackEd number. // int E_SafeStateNameOrLabel(mobjinfo_t *mi, const char *name) { char *pos = nullptr; long num = strtol(name, &pos, 0); // Not a number? It is a state name. if(estrnonempty(pos)) { int statenum = NullStateNum; state_t *state = nullptr; // Try global resolution first. if((statenum = E_StateNumForName(name)) < 0) { // Try DECORATE state label resolution. if((state = E_GetJumpInfo(mi, name))) statenum = state->index; } return statenum; } else return E_SafeState((int)num); // DeHackEd number }
// // If it doesn't have an alt atkstate, it can't have an alt fire // bool E_WeaponHasAltFire(const weaponinfo_t *wp) { return wp->atkstate_alt != E_SafeState(S_NULL); }