From 7518c02ed60c1855ba2cbd22c43f1e81217da79b Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Mon, 19 Sep 2022 23:59:57 +0300 Subject: [PATCH 01/15] Make genptr.py generate correct pointer types. --- src/baseq2/genptr.py | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/baseq2/genptr.py b/src/baseq2/genptr.py index 3ad55eb75..41967d524 100755 --- a/src/baseq2/genptr.py +++ b/src/baseq2/genptr.py @@ -3,25 +3,39 @@ import re import sys -pointers = [ - 'prethink', 'think', 'blocked', 'touch', 'use', 'pain', 'die', - 'moveinfo_endfunc', 'monsterinfo_currentmove', 'monsterinfo_stand', - 'monsterinfo_idle', 'monsterinfo_search', 'monsterinfo_walk', - 'monsterinfo_run', 'monsterinfo_dodge', 'monsterinfo_attack', - 'monsterinfo_melee', 'monsterinfo_sight', 'monsterinfo_checkattack' -] +pointers = { + 'prethink' : 'void {p}(edict_t *)', + 'think' : 'void {p}(edict_t *)', + 'blocked' : 'void {p}(edict_t *, edict_t *)', + 'touch' : 'void {p}(edict_t *, edict_t *, cplane_t *, csurface_t *)', + 'use' : 'void {p}(edict_t *, edict_t *, edict_t *)', + 'pain' : 'void {p}(edict_t *, edict_t *, float, int)', + 'die' : 'void {p}(edict_t *, edict_t *, edict_t *, int, vec3_t)', + 'moveinfo_endfunc' : 'void {p}(edict_t *)', + 'monsterinfo_currentmove' : 'mmove_t {p}', + 'monsterinfo_stand' : 'void {p}(edict_t *)', + 'monsterinfo_idle' : 'void {p}(edict_t *)', + 'monsterinfo_search' : 'void {p}(edict_t *)', + 'monsterinfo_walk' : 'void {p}(edict_t *)', + 'monsterinfo_run' : 'void {p}(edict_t *)', + 'monsterinfo_dodge' : 'void {p}(edict_t *, edict_t *, float)', + 'monsterinfo_attack' : 'void {p}(edict_t *)', + 'monsterinfo_melee' : 'void {p}(edict_t *)', + 'monsterinfo_sight' : 'void {p}(edict_t *, edict_t *)', + 'monsterinfo_checkattack' : 'bool {p}(edict_t *)', +} if __name__ == "__main__": if len(sys.argv) < 2: print('Usage: genptr.py [...]') sys.exit(1) - exprs = '|'.join(p.replace('_', '\\.') for p in pointers if not p == 'moveinfo_endfunc') + exprs = '|'.join(p.replace('_', '\\.') for p in pointers.keys() if not p == 'moveinfo_endfunc') regex = re.compile(r'->\s*(%s)\s*=\s*&?\s*(\w+)' % exprs, re.ASCII) regex2 = re.compile(r'\b(?:Angle)?Move_Calc\s*\(.+,\s*(\w+)\s*\)', re.ASCII) types = {} - for p in pointers: + for p in pointers.keys(): types[p] = [] for a in sys.argv[1:]: @@ -45,15 +59,13 @@ print('// generated by genptr.py, do not modify') + print('#include "g_local.h"') print('#include "g_ptrs.h"') decls = [] for k, v in types.items(): for p in v: - if k == 'monsterinfo_currentmove': - decls.append(f'extern int {p};') - else: - decls.append(f'extern void {p}(void);') + decls.append('extern ' + pointers[k].replace('{p}', p) + ';') for d in sorted(decls, key=str.lower): print(d) From 0c1f4560fa602d844b49688a74943427af38f516 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Tue, 20 Sep 2022 00:01:45 +0300 Subject: [PATCH 02/15] Regenerate savegame pointer table. --- src/baseq2/g_ptrs.c | 1211 ++++++++++++++++++++++--------------------- 1 file changed, 606 insertions(+), 605 deletions(-) diff --git a/src/baseq2/g_ptrs.c b/src/baseq2/g_ptrs.c index 4935d23b1..efd0a053a 100644 --- a/src/baseq2/g_ptrs.c +++ b/src/baseq2/g_ptrs.c @@ -1,610 +1,611 @@ // generated by genptr.py, do not modify +#include "g_local.h" #include "g_ptrs.h" -extern int actor_move_attack; -extern int actor_move_death1; -extern int actor_move_death2; -extern int actor_move_flipoff; -extern int actor_move_pain1; -extern int actor_move_pain2; -extern int actor_move_pain3; -extern int actor_move_run; -extern int actor_move_stand; -extern int actor_move_taunt; -extern int actor_move_walk; -extern int berserk_move_attack_club; -extern int berserk_move_attack_spike; -extern int berserk_move_death1; -extern int berserk_move_death2; -extern int berserk_move_pain1; -extern int berserk_move_pain2; -extern int berserk_move_run1; -extern int berserk_move_stand; -extern int berserk_move_stand_fidget; -extern int berserk_move_walk; -extern int boss2_move_attack_mg; -extern int boss2_move_attack_post_mg; -extern int boss2_move_attack_pre_mg; -extern int boss2_move_attack_rocket; -extern int boss2_move_death; -extern int boss2_move_pain_heavy; -extern int boss2_move_pain_light; -extern int boss2_move_run; -extern int boss2_move_stand; -extern int boss2_move_walk; -extern int brain_move_attack1; -extern int brain_move_attack2; -extern int brain_move_death1; -extern int brain_move_death2; -extern int brain_move_duck; -extern int brain_move_idle; -extern int brain_move_pain1; -extern int brain_move_pain2; -extern int brain_move_pain3; -extern int brain_move_run; -extern int brain_move_stand; -extern int brain_move_walk1; -extern int chick_move_attack1; -extern int chick_move_death1; -extern int chick_move_death2; -extern int chick_move_duck; -extern int chick_move_end_attack1; -extern int chick_move_end_slash; -extern int chick_move_fidget; -extern int chick_move_pain1; -extern int chick_move_pain2; -extern int chick_move_pain3; -extern int chick_move_run; -extern int chick_move_slash; -extern int chick_move_stand; -extern int chick_move_start_attack1; -extern int chick_move_start_run; -extern int chick_move_start_slash; -extern int chick_move_walk; -extern int flipper_move_attack; -extern int flipper_move_death; -extern int flipper_move_pain1; -extern int flipper_move_pain2; -extern int flipper_move_run_loop; -extern int flipper_move_run_start; -extern int flipper_move_stand; -extern int flipper_move_start_run; -extern int flipper_move_walk; -extern int floater_move_attack1; -extern int floater_move_attack2; -extern int floater_move_attack3; -extern int floater_move_pain1; -extern int floater_move_pain2; -extern int floater_move_run; -extern int floater_move_stand1; -extern int floater_move_stand2; -extern int floater_move_walk; -extern int flyer_move_attack2; -extern int flyer_move_end_melee; -extern int flyer_move_loop_melee; -extern int flyer_move_pain1; -extern int flyer_move_pain2; -extern int flyer_move_pain3; -extern int flyer_move_run; -extern int flyer_move_stand; -extern int flyer_move_start; -extern int flyer_move_start_melee; -extern int flyer_move_stop; -extern int flyer_move_walk; -extern int gladiator_move_attack_gun; -extern int gladiator_move_attack_melee; -extern int gladiator_move_death; -extern int gladiator_move_pain; -extern int gladiator_move_pain_air; -extern int gladiator_move_run; -extern int gladiator_move_stand; -extern int gladiator_move_walk; -extern int gunner_move_attack_chain; -extern int gunner_move_attack_grenade; -extern int gunner_move_death; -extern int gunner_move_duck; -extern int gunner_move_endfire_chain; -extern int gunner_move_fidget; -extern int gunner_move_fire_chain; -extern int gunner_move_pain1; -extern int gunner_move_pain2; -extern int gunner_move_pain3; -extern int gunner_move_run; -extern int gunner_move_runandshoot; -extern int gunner_move_stand; -extern int gunner_move_walk; -extern int hover_move_attack1; -extern int hover_move_death1; -extern int hover_move_end_attack; -extern int hover_move_pain1; -extern int hover_move_pain2; -extern int hover_move_pain3; -extern int hover_move_run; -extern int hover_move_stand; -extern int hover_move_start_attack; -extern int hover_move_walk; -extern int infantry_move_attack1; -extern int infantry_move_attack2; -extern int infantry_move_death1; -extern int infantry_move_death2; -extern int infantry_move_death3; -extern int infantry_move_duck; -extern int infantry_move_fidget; -extern int infantry_move_pain1; -extern int infantry_move_pain2; -extern int infantry_move_run; -extern int infantry_move_stand; -extern int infantry_move_walk; -extern int insane_move_crawl; -extern int insane_move_crawl_death; -extern int insane_move_crawl_pain; -extern int insane_move_cross; -extern int insane_move_down; -extern int insane_move_downtoup; -extern int insane_move_jumpdown; -extern int insane_move_run_insane; -extern int insane_move_run_normal; -extern int insane_move_runcrawl; -extern int insane_move_stand_death; -extern int insane_move_stand_insane; -extern int insane_move_stand_normal; -extern int insane_move_stand_pain; -extern int insane_move_struggle_cross; -extern int insane_move_uptodown; -extern int insane_move_walk_insane; -extern int insane_move_walk_normal; -extern int jorg_move_attack1; -extern int jorg_move_attack2; -extern int jorg_move_death; -extern int jorg_move_end_attack1; -extern int jorg_move_pain1; -extern int jorg_move_pain2; -extern int jorg_move_pain3; -extern int jorg_move_run; -extern int jorg_move_stand; -extern int jorg_move_start_attack1; -extern int jorg_move_walk; -extern int makron_move_attack3; -extern int makron_move_attack4; -extern int makron_move_attack5; -extern int makron_move_death2; -extern int makron_move_pain4; -extern int makron_move_pain5; -extern int makron_move_pain6; -extern int makron_move_run; -extern int makron_move_sight; -extern int makron_move_stand; -extern int makron_move_walk; -extern int medic_move_attackBlaster; -extern int medic_move_attackCable; -extern int medic_move_attackHyperBlaster; -extern int medic_move_death; -extern int medic_move_duck; -extern int medic_move_pain1; -extern int medic_move_pain2; -extern int medic_move_run; -extern int medic_move_stand; -extern int medic_move_walk; -extern int mutant_move_attack; -extern int mutant_move_death1; -extern int mutant_move_death2; -extern int mutant_move_idle; -extern int mutant_move_jump; -extern int mutant_move_pain1; -extern int mutant_move_pain2; -extern int mutant_move_pain3; -extern int mutant_move_run; -extern int mutant_move_stand; -extern int mutant_move_start_walk; -extern int mutant_move_walk; -extern int parasite_move_death; -extern int parasite_move_drain; -extern int parasite_move_end_fidget; -extern int parasite_move_fidget; -extern int parasite_move_pain1; -extern int parasite_move_run; -extern int parasite_move_stand; -extern int parasite_move_start_fidget; -extern int parasite_move_start_run; -extern int parasite_move_start_walk; -extern int parasite_move_walk; -extern int soldier_move_attack1; -extern int soldier_move_attack2; -extern int soldier_move_attack3; -extern int soldier_move_attack4; -extern int soldier_move_attack6; -extern int soldier_move_death1; -extern int soldier_move_death2; -extern int soldier_move_death3; -extern int soldier_move_death4; -extern int soldier_move_death5; -extern int soldier_move_death6; -extern int soldier_move_duck; -extern int soldier_move_pain1; -extern int soldier_move_pain2; -extern int soldier_move_pain3; -extern int soldier_move_pain4; -extern int soldier_move_run; -extern int soldier_move_stand1; -extern int soldier_move_stand3; -extern int soldier_move_start_run; -extern int soldier_move_walk1; -extern int soldier_move_walk2; -extern int supertank_move_attack1; -extern int supertank_move_attack2; -extern int supertank_move_death; -extern int supertank_move_end_attack1; -extern int supertank_move_forward; -extern int supertank_move_pain1; -extern int supertank_move_pain2; -extern int supertank_move_pain3; -extern int supertank_move_run; -extern int supertank_move_stand; -extern int tank_move_attack_blast; -extern int tank_move_attack_chain; -extern int tank_move_attack_fire_rocket; -extern int tank_move_attack_post_blast; -extern int tank_move_attack_post_rocket; -extern int tank_move_attack_pre_rocket; -extern int tank_move_attack_strike; -extern int tank_move_death; -extern int tank_move_pain1; -extern int tank_move_pain2; -extern int tank_move_pain3; -extern int tank_move_reattack_blast; -extern int tank_move_run; -extern int tank_move_stand; -extern int tank_move_start_run; -extern int tank_move_walk; -extern void actor_attack(void); -extern void actor_die(void); -extern void actor_pain(void); -extern void actor_run(void); -extern void actor_stand(void); -extern void actor_use(void); -extern void actor_walk(void); -extern void AngleMove_Begin(void); -extern void AngleMove_Done(void); -extern void AngleMove_Final(void); -extern void barrel_delay(void); -extern void barrel_explode(void); -extern void barrel_touch(void); -extern void berserk_die(void); -extern void berserk_melee(void); -extern void berserk_pain(void); -extern void berserk_run(void); -extern void berserk_search(void); -extern void berserk_sight(void); -extern void berserk_stand(void); -extern void berserk_walk(void); -extern void bfg_explode(void); -extern void bfg_think(void); -extern void bfg_touch(void); -extern void blaster_touch(void); -extern void body_die(void); -extern void boss2_attack(void); -extern void Boss2_CheckAttack(void); -extern void boss2_die(void); -extern void boss2_pain(void); -extern void boss2_run(void); -extern void boss2_search(void); -extern void boss2_stand(void); -extern void boss2_walk(void); -extern void BossExplode(void); -extern void brain_die(void); -extern void brain_dodge(void); -extern void brain_idle(void); -extern void brain_melee(void); -extern void brain_pain(void); -extern void brain_run(void); -extern void brain_search(void); -extern void brain_sight(void); -extern void brain_stand(void); -extern void brain_walk(void); -extern void button_done(void); -extern void button_killed(void); -extern void button_return(void); -extern void button_touch(void); -extern void button_use(void); -extern void button_wait(void); -extern void chick_attack(void); -extern void chick_die(void); -extern void chick_dodge(void); -extern void chick_melee(void); -extern void chick_pain(void); -extern void chick_run(void); -extern void chick_sight(void); -extern void chick_stand(void); -extern void chick_walk(void); -extern void commander_body_drop(void); -extern void commander_body_think(void); -extern void commander_body_use(void); -extern void debris_die(void); -extern void door_blocked(void); -extern void door_go_down(void); -extern void door_hit_bottom(void); -extern void door_hit_top(void); -extern void door_killed(void); -extern void door_secret_blocked(void); -extern void door_secret_die(void); -extern void door_secret_done(void); -extern void door_secret_move1(void); -extern void door_secret_move2(void); -extern void door_secret_move3(void); -extern void door_secret_move4(void); -extern void door_secret_move5(void); -extern void door_secret_move6(void); -extern void door_secret_use(void); -extern void door_touch(void); -extern void door_use(void); -extern void DoRespawn(void); -extern void drop_make_touchable(void); -extern void drop_temp_touch(void); -extern void droptofloor(void); -extern void flare_think(void); -extern void flare_touch(void); -extern void flipper_die(void); -extern void flipper_melee(void); -extern void flipper_pain(void); -extern void flipper_sight(void); -extern void flipper_stand(void); -extern void flipper_start_run(void); -extern void flipper_walk(void); -extern void floater_attack(void); -extern void floater_die(void); -extern void floater_idle(void); -extern void floater_melee(void); -extern void floater_pain(void); -extern void floater_run(void); -extern void floater_sight(void); -extern void floater_stand(void); -extern void floater_walk(void); -extern void flyer_attack(void); -extern void flyer_die(void); -extern void flyer_idle(void); -extern void flyer_melee(void); -extern void flyer_pain(void); -extern void flyer_run(void); -extern void flyer_sight(void); -extern void flyer_stand(void); -extern void flyer_walk(void); -extern void flymonster_start_go(void); -extern void func_clock_think(void); -extern void func_clock_use(void); -extern void func_conveyor_use(void); -extern void func_explosive_explode(void); -extern void func_explosive_spawn(void); -extern void func_explosive_use(void); -extern void func_object_release(void); -extern void func_object_touch(void); -extern void func_object_use(void); -extern void func_timer_think(void); -extern void func_timer_use(void); -extern void func_train_find(void); -extern void func_wall_use(void); -extern void G_FreeEdict(void); -extern void gib_die(void); -extern void gib_think(void); -extern void gib_touch(void); -extern void gladiator_attack(void); -extern void gladiator_die(void); -extern void gladiator_idle(void); -extern void gladiator_melee(void); -extern void gladiator_pain(void); -extern void gladiator_run(void); -extern void gladiator_search(void); -extern void gladiator_sight(void); -extern void gladiator_stand(void); -extern void gladiator_walk(void); -extern void Grenade_Explode(void); -extern void Grenade_Touch(void); -extern void gunner_attack(void); -extern void gunner_die(void); -extern void gunner_dodge(void); -extern void gunner_pain(void); -extern void gunner_run(void); -extern void gunner_search(void); -extern void gunner_sight(void); -extern void gunner_stand(void); -extern void gunner_walk(void); -extern void hover_deadthink(void); -extern void hover_die(void); -extern void hover_pain(void); -extern void hover_run(void); -extern void hover_search(void); -extern void hover_sight(void); -extern void hover_stand(void); -extern void hover_start_attack(void); -extern void hover_walk(void); -extern void hurt_touch(void); -extern void hurt_use(void); -extern void infantry_attack(void); -extern void infantry_die(void); -extern void infantry_dodge(void); -extern void infantry_fidget(void); -extern void infantry_pain(void); -extern void infantry_run(void); -extern void infantry_sight(void); -extern void infantry_stand(void); -extern void infantry_walk(void); -extern void insane_die(void); -extern void insane_pain(void); -extern void insane_run(void); -extern void insane_stand(void); -extern void insane_walk(void); -extern void jorg_attack(void); -extern void Jorg_CheckAttack(void); -extern void jorg_die(void); -extern void jorg_pain(void); -extern void jorg_run(void); -extern void jorg_search(void); -extern void jorg_stand(void); -extern void jorg_walk(void); -extern void light_use(void); -extern void M_CheckAttack(void); -extern void M_droptofloor(void); -extern void M_FliesOff(void); -extern void M_FliesOn(void); -extern void makron_attack(void); -extern void Makron_CheckAttack(void); -extern void makron_die(void); -extern void makron_pain(void); -extern void makron_run(void); -extern void makron_sight(void); -extern void makron_stand(void); -extern void makron_torso_think(void); -extern void makron_walk(void); -extern void MakronSpawn(void); -extern void medic_attack(void); -extern void medic_checkattack(void); -extern void medic_die(void); -extern void medic_dodge(void); -extern void medic_idle(void); -extern void medic_pain(void); -extern void medic_run(void); -extern void medic_search(void); -extern void medic_sight(void); -extern void medic_stand(void); -extern void medic_walk(void); -extern void MegaHealth_think(void); -extern void misc_banner_think(void); -extern void misc_blackhole_think(void); -extern void misc_blackhole_use(void); -extern void misc_deadsoldier_die(void); -extern void misc_easterchick2_think(void); -extern void misc_easterchick_think(void); -extern void misc_eastertank_think(void); -extern void misc_satellite_dish_think(void); -extern void misc_satellite_dish_use(void); -extern void misc_strogg_ship_use(void); -extern void misc_viper_bomb_prethink(void); -extern void misc_viper_bomb_touch(void); -extern void misc_viper_bomb_use(void); -extern void misc_viper_use(void); -extern void monster_think(void); -extern void monster_triggered_spawn(void); -extern void monster_triggered_spawn_use(void); -extern void monster_use(void); -extern void Move_Begin(void); -extern void Move_Done(void); -extern void Move_Final(void); -extern void multi_wait(void); -extern void mutant_checkattack(void); -extern void mutant_die(void); -extern void mutant_idle(void); -extern void mutant_jump(void); -extern void mutant_jump_touch(void); -extern void mutant_melee(void); -extern void mutant_pain(void); -extern void mutant_run(void); -extern void mutant_search(void); -extern void mutant_sight(void); -extern void mutant_stand(void); -extern void mutant_walk(void); -extern void parasite_attack(void); -extern void parasite_die(void); -extern void parasite_idle(void); -extern void parasite_pain(void); -extern void parasite_sight(void); -extern void parasite_stand(void); -extern void parasite_start_run(void); -extern void parasite_start_walk(void); -extern void path_corner_touch(void); -extern void plat_blocked(void); -extern void plat_go_down(void); -extern void plat_hit_bottom(void); -extern void plat_hit_top(void); -extern void player_die(void); -extern void player_pain(void); -extern void point_combat_touch(void); -extern void rocket_touch(void); -extern void rotating_blocked(void); -extern void rotating_touch(void); -extern void rotating_use(void); -extern void soldier_attack(void); -extern void soldier_die(void); -extern void soldier_dodge(void); -extern void soldier_pain(void); -extern void soldier_run(void); -extern void soldier_sight(void); -extern void soldier_stand(void); -extern void soldier_walk(void); -extern void SP_CreateCoopSpots(void); -extern void SP_FixCoopSpots(void); -extern void supertank_attack(void); -extern void supertank_die(void); -extern void supertank_pain(void); -extern void supertank_run(void); -extern void supertank_search(void); -extern void supertank_stand(void); -extern void supertank_walk(void); -extern void swimmonster_start_go(void); -extern void tank_attack(void); -extern void tank_die(void); -extern void tank_idle(void); -extern void tank_pain(void); -extern void tank_run(void); -extern void tank_sight(void); -extern void tank_stand(void); -extern void tank_walk(void); -extern void target_actor_touch(void); -extern void target_crosslevel_target_think(void); -extern void target_earthquake_think(void); -extern void target_earthquake_use(void); -extern void target_explosion_explode(void); -extern void target_laser_start(void); -extern void target_laser_think(void); -extern void target_laser_use(void); -extern void target_lightramp_think(void); -extern void target_lightramp_use(void); -extern void target_string_use(void); -extern void teleporter_touch(void); -extern void TH_viewthing(void); -extern void Think_AccelMove(void); -extern void Think_Boss3Stand(void); -extern void Think_CalcMoveSpeed(void); -extern void Think_Delay(void); -extern void Think_SpawnDoorTrigger(void); -extern void Touch_DoorTrigger(void); -extern void Touch_Item(void); -extern void Touch_Multi(void); -extern void Touch_Plat_Center(void); -extern void train_blocked(void); -extern void train_next(void); -extern void train_use(void); -extern void train_wait(void); -extern void trigger_counter_use(void); -extern void trigger_crosslevel_trigger_use(void); -extern void trigger_elevator_init(void); -extern void trigger_elevator_use(void); -extern void trigger_enable(void); -extern void trigger_gravity_touch(void); -extern void trigger_key_use(void); -extern void trigger_monsterjump_touch(void); -extern void trigger_push_touch(void); -extern void trigger_relay_use(void); -extern void turret_blocked(void); -extern void turret_breach_finish_init(void); -extern void turret_breach_think(void); -extern void turret_driver_die(void); -extern void turret_driver_link(void); -extern void turret_driver_think(void); -extern void Use_Areaportal(void); -extern void Use_Boss3(void); -extern void Use_Item(void); -extern void use_killbox(void); -extern void Use_Multi(void); -extern void Use_Plat(void); -extern void use_target_blaster(void); -extern void use_target_changelevel(void); -extern void use_target_explosion(void); -extern void use_target_goal(void); -extern void Use_Target_Help(void); -extern void use_target_secret(void); -extern void use_target_spawner(void); -extern void Use_Target_Speaker(void); -extern void use_target_splash(void); -extern void Use_Target_Tent(void); -extern void walkmonster_start_go(void); +extern bool Boss2_CheckAttack(edict_t *); +extern bool Jorg_CheckAttack(edict_t *); +extern bool M_CheckAttack(edict_t *); +extern bool Makron_CheckAttack(edict_t *); +extern bool medic_checkattack(edict_t *); +extern bool mutant_checkattack(edict_t *); +extern mmove_t actor_move_attack; +extern mmove_t actor_move_death1; +extern mmove_t actor_move_death2; +extern mmove_t actor_move_flipoff; +extern mmove_t actor_move_pain1; +extern mmove_t actor_move_pain2; +extern mmove_t actor_move_pain3; +extern mmove_t actor_move_run; +extern mmove_t actor_move_stand; +extern mmove_t actor_move_taunt; +extern mmove_t actor_move_walk; +extern mmove_t berserk_move_attack_club; +extern mmove_t berserk_move_attack_spike; +extern mmove_t berserk_move_death1; +extern mmove_t berserk_move_death2; +extern mmove_t berserk_move_pain1; +extern mmove_t berserk_move_pain2; +extern mmove_t berserk_move_run1; +extern mmove_t berserk_move_stand; +extern mmove_t berserk_move_stand_fidget; +extern mmove_t berserk_move_walk; +extern mmove_t boss2_move_attack_mg; +extern mmove_t boss2_move_attack_post_mg; +extern mmove_t boss2_move_attack_pre_mg; +extern mmove_t boss2_move_attack_rocket; +extern mmove_t boss2_move_death; +extern mmove_t boss2_move_pain_heavy; +extern mmove_t boss2_move_pain_light; +extern mmove_t boss2_move_run; +extern mmove_t boss2_move_stand; +extern mmove_t boss2_move_walk; +extern mmove_t brain_move_attack1; +extern mmove_t brain_move_attack2; +extern mmove_t brain_move_death1; +extern mmove_t brain_move_death2; +extern mmove_t brain_move_duck; +extern mmove_t brain_move_idle; +extern mmove_t brain_move_pain1; +extern mmove_t brain_move_pain2; +extern mmove_t brain_move_pain3; +extern mmove_t brain_move_run; +extern mmove_t brain_move_stand; +extern mmove_t brain_move_walk1; +extern mmove_t chick_move_attack1; +extern mmove_t chick_move_death1; +extern mmove_t chick_move_death2; +extern mmove_t chick_move_duck; +extern mmove_t chick_move_end_attack1; +extern mmove_t chick_move_end_slash; +extern mmove_t chick_move_fidget; +extern mmove_t chick_move_pain1; +extern mmove_t chick_move_pain2; +extern mmove_t chick_move_pain3; +extern mmove_t chick_move_run; +extern mmove_t chick_move_slash; +extern mmove_t chick_move_stand; +extern mmove_t chick_move_start_attack1; +extern mmove_t chick_move_start_run; +extern mmove_t chick_move_start_slash; +extern mmove_t chick_move_walk; +extern mmove_t flipper_move_attack; +extern mmove_t flipper_move_death; +extern mmove_t flipper_move_pain1; +extern mmove_t flipper_move_pain2; +extern mmove_t flipper_move_run_loop; +extern mmove_t flipper_move_run_start; +extern mmove_t flipper_move_stand; +extern mmove_t flipper_move_start_run; +extern mmove_t flipper_move_walk; +extern mmove_t floater_move_attack1; +extern mmove_t floater_move_attack2; +extern mmove_t floater_move_attack3; +extern mmove_t floater_move_pain1; +extern mmove_t floater_move_pain2; +extern mmove_t floater_move_run; +extern mmove_t floater_move_stand1; +extern mmove_t floater_move_stand2; +extern mmove_t floater_move_walk; +extern mmove_t flyer_move_attack2; +extern mmove_t flyer_move_end_melee; +extern mmove_t flyer_move_loop_melee; +extern mmove_t flyer_move_pain1; +extern mmove_t flyer_move_pain2; +extern mmove_t flyer_move_pain3; +extern mmove_t flyer_move_run; +extern mmove_t flyer_move_stand; +extern mmove_t flyer_move_start; +extern mmove_t flyer_move_start_melee; +extern mmove_t flyer_move_stop; +extern mmove_t flyer_move_walk; +extern mmove_t gladiator_move_attack_gun; +extern mmove_t gladiator_move_attack_melee; +extern mmove_t gladiator_move_death; +extern mmove_t gladiator_move_pain; +extern mmove_t gladiator_move_pain_air; +extern mmove_t gladiator_move_run; +extern mmove_t gladiator_move_stand; +extern mmove_t gladiator_move_walk; +extern mmove_t gunner_move_attack_chain; +extern mmove_t gunner_move_attack_grenade; +extern mmove_t gunner_move_death; +extern mmove_t gunner_move_duck; +extern mmove_t gunner_move_endfire_chain; +extern mmove_t gunner_move_fidget; +extern mmove_t gunner_move_fire_chain; +extern mmove_t gunner_move_pain1; +extern mmove_t gunner_move_pain2; +extern mmove_t gunner_move_pain3; +extern mmove_t gunner_move_run; +extern mmove_t gunner_move_runandshoot; +extern mmove_t gunner_move_stand; +extern mmove_t gunner_move_walk; +extern mmove_t hover_move_attack1; +extern mmove_t hover_move_death1; +extern mmove_t hover_move_end_attack; +extern mmove_t hover_move_pain1; +extern mmove_t hover_move_pain2; +extern mmove_t hover_move_pain3; +extern mmove_t hover_move_run; +extern mmove_t hover_move_stand; +extern mmove_t hover_move_start_attack; +extern mmove_t hover_move_walk; +extern mmove_t infantry_move_attack1; +extern mmove_t infantry_move_attack2; +extern mmove_t infantry_move_death1; +extern mmove_t infantry_move_death2; +extern mmove_t infantry_move_death3; +extern mmove_t infantry_move_duck; +extern mmove_t infantry_move_fidget; +extern mmove_t infantry_move_pain1; +extern mmove_t infantry_move_pain2; +extern mmove_t infantry_move_run; +extern mmove_t infantry_move_stand; +extern mmove_t infantry_move_walk; +extern mmove_t insane_move_crawl; +extern mmove_t insane_move_crawl_death; +extern mmove_t insane_move_crawl_pain; +extern mmove_t insane_move_cross; +extern mmove_t insane_move_down; +extern mmove_t insane_move_downtoup; +extern mmove_t insane_move_jumpdown; +extern mmove_t insane_move_run_insane; +extern mmove_t insane_move_run_normal; +extern mmove_t insane_move_runcrawl; +extern mmove_t insane_move_stand_death; +extern mmove_t insane_move_stand_insane; +extern mmove_t insane_move_stand_normal; +extern mmove_t insane_move_stand_pain; +extern mmove_t insane_move_struggle_cross; +extern mmove_t insane_move_uptodown; +extern mmove_t insane_move_walk_insane; +extern mmove_t insane_move_walk_normal; +extern mmove_t jorg_move_attack1; +extern mmove_t jorg_move_attack2; +extern mmove_t jorg_move_death; +extern mmove_t jorg_move_end_attack1; +extern mmove_t jorg_move_pain1; +extern mmove_t jorg_move_pain2; +extern mmove_t jorg_move_pain3; +extern mmove_t jorg_move_run; +extern mmove_t jorg_move_stand; +extern mmove_t jorg_move_start_attack1; +extern mmove_t jorg_move_walk; +extern mmove_t makron_move_attack3; +extern mmove_t makron_move_attack4; +extern mmove_t makron_move_attack5; +extern mmove_t makron_move_death2; +extern mmove_t makron_move_pain4; +extern mmove_t makron_move_pain5; +extern mmove_t makron_move_pain6; +extern mmove_t makron_move_run; +extern mmove_t makron_move_sight; +extern mmove_t makron_move_stand; +extern mmove_t makron_move_walk; +extern mmove_t medic_move_attackBlaster; +extern mmove_t medic_move_attackCable; +extern mmove_t medic_move_attackHyperBlaster; +extern mmove_t medic_move_death; +extern mmove_t medic_move_duck; +extern mmove_t medic_move_pain1; +extern mmove_t medic_move_pain2; +extern mmove_t medic_move_run; +extern mmove_t medic_move_stand; +extern mmove_t medic_move_walk; +extern mmove_t mutant_move_attack; +extern mmove_t mutant_move_death1; +extern mmove_t mutant_move_death2; +extern mmove_t mutant_move_idle; +extern mmove_t mutant_move_jump; +extern mmove_t mutant_move_pain1; +extern mmove_t mutant_move_pain2; +extern mmove_t mutant_move_pain3; +extern mmove_t mutant_move_run; +extern mmove_t mutant_move_stand; +extern mmove_t mutant_move_start_walk; +extern mmove_t mutant_move_walk; +extern mmove_t parasite_move_death; +extern mmove_t parasite_move_drain; +extern mmove_t parasite_move_end_fidget; +extern mmove_t parasite_move_fidget; +extern mmove_t parasite_move_pain1; +extern mmove_t parasite_move_run; +extern mmove_t parasite_move_stand; +extern mmove_t parasite_move_start_fidget; +extern mmove_t parasite_move_start_run; +extern mmove_t parasite_move_start_walk; +extern mmove_t parasite_move_walk; +extern mmove_t soldier_move_attack1; +extern mmove_t soldier_move_attack2; +extern mmove_t soldier_move_attack3; +extern mmove_t soldier_move_attack4; +extern mmove_t soldier_move_attack6; +extern mmove_t soldier_move_death1; +extern mmove_t soldier_move_death2; +extern mmove_t soldier_move_death3; +extern mmove_t soldier_move_death4; +extern mmove_t soldier_move_death5; +extern mmove_t soldier_move_death6; +extern mmove_t soldier_move_duck; +extern mmove_t soldier_move_pain1; +extern mmove_t soldier_move_pain2; +extern mmove_t soldier_move_pain3; +extern mmove_t soldier_move_pain4; +extern mmove_t soldier_move_run; +extern mmove_t soldier_move_stand1; +extern mmove_t soldier_move_stand3; +extern mmove_t soldier_move_start_run; +extern mmove_t soldier_move_walk1; +extern mmove_t soldier_move_walk2; +extern mmove_t supertank_move_attack1; +extern mmove_t supertank_move_attack2; +extern mmove_t supertank_move_death; +extern mmove_t supertank_move_end_attack1; +extern mmove_t supertank_move_forward; +extern mmove_t supertank_move_pain1; +extern mmove_t supertank_move_pain2; +extern mmove_t supertank_move_pain3; +extern mmove_t supertank_move_run; +extern mmove_t supertank_move_stand; +extern mmove_t tank_move_attack_blast; +extern mmove_t tank_move_attack_chain; +extern mmove_t tank_move_attack_fire_rocket; +extern mmove_t tank_move_attack_post_blast; +extern mmove_t tank_move_attack_post_rocket; +extern mmove_t tank_move_attack_pre_rocket; +extern mmove_t tank_move_attack_strike; +extern mmove_t tank_move_death; +extern mmove_t tank_move_pain1; +extern mmove_t tank_move_pain2; +extern mmove_t tank_move_pain3; +extern mmove_t tank_move_reattack_blast; +extern mmove_t tank_move_run; +extern mmove_t tank_move_stand; +extern mmove_t tank_move_start_run; +extern mmove_t tank_move_walk; +extern void actor_attack(edict_t *); +extern void actor_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void actor_pain(edict_t *, edict_t *, float, int); +extern void actor_run(edict_t *); +extern void actor_stand(edict_t *); +extern void actor_use(edict_t *, edict_t *, edict_t *); +extern void actor_walk(edict_t *); +extern void AngleMove_Begin(edict_t *); +extern void AngleMove_Done(edict_t *); +extern void AngleMove_Final(edict_t *); +extern void barrel_delay(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void barrel_explode(edict_t *); +extern void barrel_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void berserk_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void berserk_melee(edict_t *); +extern void berserk_pain(edict_t *, edict_t *, float, int); +extern void berserk_run(edict_t *); +extern void berserk_search(edict_t *); +extern void berserk_sight(edict_t *, edict_t *); +extern void berserk_stand(edict_t *); +extern void berserk_walk(edict_t *); +extern void bfg_explode(edict_t *); +extern void bfg_think(edict_t *); +extern void bfg_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void blaster_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void body_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void boss2_attack(edict_t *); +extern void boss2_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void boss2_pain(edict_t *, edict_t *, float, int); +extern void boss2_run(edict_t *); +extern void boss2_search(edict_t *); +extern void boss2_stand(edict_t *); +extern void boss2_walk(edict_t *); +extern void BossExplode(edict_t *); +extern void brain_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void brain_dodge(edict_t *, edict_t *, float); +extern void brain_idle(edict_t *); +extern void brain_melee(edict_t *); +extern void brain_pain(edict_t *, edict_t *, float, int); +extern void brain_run(edict_t *); +extern void brain_search(edict_t *); +extern void brain_sight(edict_t *, edict_t *); +extern void brain_stand(edict_t *); +extern void brain_walk(edict_t *); +extern void button_done(edict_t *); +extern void button_killed(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void button_return(edict_t *); +extern void button_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void button_use(edict_t *, edict_t *, edict_t *); +extern void button_wait(edict_t *); +extern void chick_attack(edict_t *); +extern void chick_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void chick_dodge(edict_t *, edict_t *, float); +extern void chick_melee(edict_t *); +extern void chick_pain(edict_t *, edict_t *, float, int); +extern void chick_run(edict_t *); +extern void chick_sight(edict_t *, edict_t *); +extern void chick_stand(edict_t *); +extern void chick_walk(edict_t *); +extern void commander_body_drop(edict_t *); +extern void commander_body_think(edict_t *); +extern void commander_body_use(edict_t *, edict_t *, edict_t *); +extern void debris_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void door_blocked(edict_t *, edict_t *); +extern void door_go_down(edict_t *); +extern void door_hit_bottom(edict_t *); +extern void door_hit_top(edict_t *); +extern void door_killed(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void door_secret_blocked(edict_t *, edict_t *); +extern void door_secret_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void door_secret_done(edict_t *); +extern void door_secret_move1(edict_t *); +extern void door_secret_move2(edict_t *); +extern void door_secret_move3(edict_t *); +extern void door_secret_move4(edict_t *); +extern void door_secret_move5(edict_t *); +extern void door_secret_move6(edict_t *); +extern void door_secret_use(edict_t *, edict_t *, edict_t *); +extern void door_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void door_use(edict_t *, edict_t *, edict_t *); +extern void DoRespawn(edict_t *); +extern void drop_make_touchable(edict_t *); +extern void drop_temp_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void droptofloor(edict_t *); +extern void flare_think(edict_t *); +extern void flare_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void flipper_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void flipper_melee(edict_t *); +extern void flipper_pain(edict_t *, edict_t *, float, int); +extern void flipper_sight(edict_t *, edict_t *); +extern void flipper_stand(edict_t *); +extern void flipper_start_run(edict_t *); +extern void flipper_walk(edict_t *); +extern void floater_attack(edict_t *); +extern void floater_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void floater_idle(edict_t *); +extern void floater_melee(edict_t *); +extern void floater_pain(edict_t *, edict_t *, float, int); +extern void floater_run(edict_t *); +extern void floater_sight(edict_t *, edict_t *); +extern void floater_stand(edict_t *); +extern void floater_walk(edict_t *); +extern void flyer_attack(edict_t *); +extern void flyer_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void flyer_idle(edict_t *); +extern void flyer_melee(edict_t *); +extern void flyer_pain(edict_t *, edict_t *, float, int); +extern void flyer_run(edict_t *); +extern void flyer_sight(edict_t *, edict_t *); +extern void flyer_stand(edict_t *); +extern void flyer_walk(edict_t *); +extern void flymonster_start_go(edict_t *); +extern void func_clock_think(edict_t *); +extern void func_clock_use(edict_t *, edict_t *, edict_t *); +extern void func_conveyor_use(edict_t *, edict_t *, edict_t *); +extern void func_explosive_explode(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void func_explosive_spawn(edict_t *, edict_t *, edict_t *); +extern void func_explosive_use(edict_t *, edict_t *, edict_t *); +extern void func_object_release(edict_t *); +extern void func_object_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void func_object_use(edict_t *, edict_t *, edict_t *); +extern void func_timer_think(edict_t *); +extern void func_timer_use(edict_t *, edict_t *, edict_t *); +extern void func_train_find(edict_t *); +extern void func_wall_use(edict_t *, edict_t *, edict_t *); +extern void G_FreeEdict(edict_t *); +extern void gib_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void gib_think(edict_t *); +extern void gib_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void gladiator_attack(edict_t *); +extern void gladiator_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void gladiator_idle(edict_t *); +extern void gladiator_melee(edict_t *); +extern void gladiator_pain(edict_t *, edict_t *, float, int); +extern void gladiator_run(edict_t *); +extern void gladiator_search(edict_t *); +extern void gladiator_sight(edict_t *, edict_t *); +extern void gladiator_stand(edict_t *); +extern void gladiator_walk(edict_t *); +extern void Grenade_Explode(edict_t *); +extern void Grenade_Touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void gunner_attack(edict_t *); +extern void gunner_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void gunner_dodge(edict_t *, edict_t *, float); +extern void gunner_pain(edict_t *, edict_t *, float, int); +extern void gunner_run(edict_t *); +extern void gunner_search(edict_t *); +extern void gunner_sight(edict_t *, edict_t *); +extern void gunner_stand(edict_t *); +extern void gunner_walk(edict_t *); +extern void hover_deadthink(edict_t *); +extern void hover_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void hover_pain(edict_t *, edict_t *, float, int); +extern void hover_run(edict_t *); +extern void hover_search(edict_t *); +extern void hover_sight(edict_t *, edict_t *); +extern void hover_stand(edict_t *); +extern void hover_start_attack(edict_t *); +extern void hover_walk(edict_t *); +extern void hurt_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void hurt_use(edict_t *, edict_t *, edict_t *); +extern void infantry_attack(edict_t *); +extern void infantry_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void infantry_dodge(edict_t *, edict_t *, float); +extern void infantry_fidget(edict_t *); +extern void infantry_pain(edict_t *, edict_t *, float, int); +extern void infantry_run(edict_t *); +extern void infantry_sight(edict_t *, edict_t *); +extern void infantry_stand(edict_t *); +extern void infantry_walk(edict_t *); +extern void insane_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void insane_pain(edict_t *, edict_t *, float, int); +extern void insane_run(edict_t *); +extern void insane_stand(edict_t *); +extern void insane_walk(edict_t *); +extern void jorg_attack(edict_t *); +extern void jorg_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void jorg_pain(edict_t *, edict_t *, float, int); +extern void jorg_run(edict_t *); +extern void jorg_search(edict_t *); +extern void jorg_stand(edict_t *); +extern void jorg_walk(edict_t *); +extern void light_use(edict_t *, edict_t *, edict_t *); +extern void M_droptofloor(edict_t *); +extern void M_FliesOff(edict_t *); +extern void M_FliesOn(edict_t *); +extern void makron_attack(edict_t *); +extern void makron_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void makron_pain(edict_t *, edict_t *, float, int); +extern void makron_run(edict_t *); +extern void makron_sight(edict_t *, edict_t *); +extern void makron_stand(edict_t *); +extern void makron_torso_think(edict_t *); +extern void makron_walk(edict_t *); +extern void MakronSpawn(edict_t *); +extern void medic_attack(edict_t *); +extern void medic_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void medic_dodge(edict_t *, edict_t *, float); +extern void medic_idle(edict_t *); +extern void medic_pain(edict_t *, edict_t *, float, int); +extern void medic_run(edict_t *); +extern void medic_search(edict_t *); +extern void medic_sight(edict_t *, edict_t *); +extern void medic_stand(edict_t *); +extern void medic_walk(edict_t *); +extern void MegaHealth_think(edict_t *); +extern void misc_banner_think(edict_t *); +extern void misc_blackhole_think(edict_t *); +extern void misc_blackhole_use(edict_t *, edict_t *, edict_t *); +extern void misc_deadsoldier_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void misc_easterchick2_think(edict_t *); +extern void misc_easterchick_think(edict_t *); +extern void misc_eastertank_think(edict_t *); +extern void misc_satellite_dish_think(edict_t *); +extern void misc_satellite_dish_use(edict_t *, edict_t *, edict_t *); +extern void misc_strogg_ship_use(edict_t *, edict_t *, edict_t *); +extern void misc_viper_bomb_prethink(edict_t *); +extern void misc_viper_bomb_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void misc_viper_bomb_use(edict_t *, edict_t *, edict_t *); +extern void misc_viper_use(edict_t *, edict_t *, edict_t *); +extern void monster_think(edict_t *); +extern void monster_triggered_spawn(edict_t *); +extern void monster_triggered_spawn_use(edict_t *, edict_t *, edict_t *); +extern void monster_use(edict_t *, edict_t *, edict_t *); +extern void Move_Begin(edict_t *); +extern void Move_Done(edict_t *); +extern void Move_Final(edict_t *); +extern void multi_wait(edict_t *); +extern void mutant_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void mutant_idle(edict_t *); +extern void mutant_jump(edict_t *); +extern void mutant_jump_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void mutant_melee(edict_t *); +extern void mutant_pain(edict_t *, edict_t *, float, int); +extern void mutant_run(edict_t *); +extern void mutant_search(edict_t *); +extern void mutant_sight(edict_t *, edict_t *); +extern void mutant_stand(edict_t *); +extern void mutant_walk(edict_t *); +extern void parasite_attack(edict_t *); +extern void parasite_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void parasite_idle(edict_t *); +extern void parasite_pain(edict_t *, edict_t *, float, int); +extern void parasite_sight(edict_t *, edict_t *); +extern void parasite_stand(edict_t *); +extern void parasite_start_run(edict_t *); +extern void parasite_start_walk(edict_t *); +extern void path_corner_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void plat_blocked(edict_t *, edict_t *); +extern void plat_go_down(edict_t *); +extern void plat_hit_bottom(edict_t *); +extern void plat_hit_top(edict_t *); +extern void player_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void player_pain(edict_t *, edict_t *, float, int); +extern void point_combat_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void rocket_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void rotating_blocked(edict_t *, edict_t *); +extern void rotating_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void rotating_use(edict_t *, edict_t *, edict_t *); +extern void soldier_attack(edict_t *); +extern void soldier_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void soldier_dodge(edict_t *, edict_t *, float); +extern void soldier_pain(edict_t *, edict_t *, float, int); +extern void soldier_run(edict_t *); +extern void soldier_sight(edict_t *, edict_t *); +extern void soldier_stand(edict_t *); +extern void soldier_walk(edict_t *); +extern void SP_CreateCoopSpots(edict_t *); +extern void SP_FixCoopSpots(edict_t *); +extern void supertank_attack(edict_t *); +extern void supertank_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void supertank_pain(edict_t *, edict_t *, float, int); +extern void supertank_run(edict_t *); +extern void supertank_search(edict_t *); +extern void supertank_stand(edict_t *); +extern void supertank_walk(edict_t *); +extern void swimmonster_start_go(edict_t *); +extern void tank_attack(edict_t *); +extern void tank_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void tank_idle(edict_t *); +extern void tank_pain(edict_t *, edict_t *, float, int); +extern void tank_run(edict_t *); +extern void tank_sight(edict_t *, edict_t *); +extern void tank_stand(edict_t *); +extern void tank_walk(edict_t *); +extern void target_actor_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void target_crosslevel_target_think(edict_t *); +extern void target_earthquake_think(edict_t *); +extern void target_earthquake_use(edict_t *, edict_t *, edict_t *); +extern void target_explosion_explode(edict_t *); +extern void target_laser_start(edict_t *); +extern void target_laser_think(edict_t *); +extern void target_laser_use(edict_t *, edict_t *, edict_t *); +extern void target_lightramp_think(edict_t *); +extern void target_lightramp_use(edict_t *, edict_t *, edict_t *); +extern void target_string_use(edict_t *, edict_t *, edict_t *); +extern void teleporter_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void TH_viewthing(edict_t *); +extern void Think_AccelMove(edict_t *); +extern void Think_Boss3Stand(edict_t *); +extern void Think_CalcMoveSpeed(edict_t *); +extern void Think_Delay(edict_t *); +extern void Think_SpawnDoorTrigger(edict_t *); +extern void Touch_DoorTrigger(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void Touch_Item(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void Touch_Multi(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void Touch_Plat_Center(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void train_blocked(edict_t *, edict_t *); +extern void train_next(edict_t *); +extern void train_use(edict_t *, edict_t *, edict_t *); +extern void train_wait(edict_t *); +extern void trigger_counter_use(edict_t *, edict_t *, edict_t *); +extern void trigger_crosslevel_trigger_use(edict_t *, edict_t *, edict_t *); +extern void trigger_elevator_init(edict_t *); +extern void trigger_elevator_use(edict_t *, edict_t *, edict_t *); +extern void trigger_enable(edict_t *, edict_t *, edict_t *); +extern void trigger_gravity_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void trigger_key_use(edict_t *, edict_t *, edict_t *); +extern void trigger_monsterjump_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void trigger_push_touch(edict_t *, edict_t *, cplane_t *, csurface_t *); +extern void trigger_relay_use(edict_t *, edict_t *, edict_t *); +extern void turret_blocked(edict_t *, edict_t *); +extern void turret_breach_finish_init(edict_t *); +extern void turret_breach_think(edict_t *); +extern void turret_driver_die(edict_t *, edict_t *, edict_t *, int, vec3_t); +extern void turret_driver_link(edict_t *); +extern void turret_driver_think(edict_t *); +extern void Use_Areaportal(edict_t *, edict_t *, edict_t *); +extern void Use_Boss3(edict_t *, edict_t *, edict_t *); +extern void Use_Item(edict_t *, edict_t *, edict_t *); +extern void use_killbox(edict_t *, edict_t *, edict_t *); +extern void Use_Multi(edict_t *, edict_t *, edict_t *); +extern void Use_Plat(edict_t *, edict_t *, edict_t *); +extern void use_target_blaster(edict_t *, edict_t *, edict_t *); +extern void use_target_changelevel(edict_t *, edict_t *, edict_t *); +extern void use_target_explosion(edict_t *, edict_t *, edict_t *); +extern void use_target_goal(edict_t *, edict_t *, edict_t *); +extern void Use_Target_Help(edict_t *, edict_t *, edict_t *); +extern void use_target_secret(edict_t *, edict_t *, edict_t *); +extern void use_target_spawner(edict_t *, edict_t *, edict_t *); +extern void Use_Target_Speaker(edict_t *, edict_t *, edict_t *); +extern void use_target_splash(edict_t *, edict_t *, edict_t *); +extern void Use_Target_Tent(edict_t *, edict_t *, edict_t *); +extern void walkmonster_start_go(edict_t *); const save_ptr_t save_ptrs[] = { { P_prethink, misc_viper_bomb_prethink }, { P_think, AngleMove_Begin }, From a5b0d41479f2d35eef357bb213ccbab4db19ba46 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Fri, 13 Jan 2023 14:21:33 +0300 Subject: [PATCH 03/15] Remove commented out monster code. --- src/baseq2/m_boss2.c | 40 ---------------- src/baseq2/m_boss31.c | 32 ------------- src/baseq2/m_brain.c | 62 ------------------------- src/baseq2/m_gunner.c | 10 ---- src/baseq2/m_insane.c | 8 ---- src/baseq2/m_parasite.c | 46 ------------------- src/baseq2/m_soldier.c | 99 ---------------------------------------- src/baseq2/m_supertank.c | 6 --- 8 files changed, 303 deletions(-) diff --git a/src/baseq2/m_boss2.c b/src/baseq2/m_boss2.c index ca8353d36..30deabad4 100644 --- a/src/baseq2/m_boss2.c +++ b/src/baseq2/m_boss2.c @@ -127,23 +127,6 @@ void boss2_firebullet_left(edict_t *self) void Boss2MachineGun(edict_t *self) { - /* vec3_t forward, right; - vec3_t start; - vec3_t dir; - vec3_t vec; - int flash_number; - - AngleVectors (self->s.angles, forward, right, NULL); - - flash_number = MZ2_BOSS2_MACHINEGUN_1 + (self->s.frame - FRAME_attack10); - G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start); - - VectorCopy (self->enemy->s.origin, vec); - vec[2] += self->enemy->viewheight; - VectorSubtract (vec, start, dir); - VectorNormalize (dir); - monster_fire_bullet (self, start, dir, 3, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number); - */ boss2_firebullet_left(self); boss2_firebullet_right(self); } @@ -490,29 +473,6 @@ void boss2_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, self->takedamage = DAMAGE_NO; self->count = 0; self->monsterinfo.currentmove = &boss2_move_death; -#if 0 - int n; - - self->s.sound = 0; - // check for gib - if (self->health <= self->gib_health) { - gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0); - for (n = 0; n < 2; n++) - ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC); - for (n = 0; n < 4; n++) - ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); - ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC); - self->deadflag = DEAD_DEAD; - return; - } - - if (self->deadflag == DEAD_DEAD) - return; - - self->deadflag = DEAD_DEAD; - self->takedamage = DAMAGE_YES; - self->monsterinfo.currentmove = &boss2_move_death; -#endif } bool Boss2_CheckAttack(edict_t *self) diff --git a/src/baseq2/m_boss31.c b/src/baseq2/m_boss31.c index 71f23478b..8c7bd944e 100644 --- a/src/baseq2/m_boss31.c +++ b/src/baseq2/m_boss31.c @@ -464,14 +464,6 @@ void jorgBFG(edict_t *self) VectorSubtract(vec, start, dir); VectorNormalize(dir); gi.sound(self, CHAN_VOICE, sound_attack2, 1, ATTN_NORM, 0); - /*void monster_fire_bfg (edict_t *self, - vec3_t start, - vec3_t aimdir, - int damage, - int speed, - int kick, - float damage_radius, - int flashtype)*/ monster_fire_bfg(self, start, dir, 50, 300, 100, 200, MZ2_JORG_BFG_1); } @@ -527,30 +519,6 @@ void jorg_attack(edict_t *self) void jorg_dead(edict_t *self) { -#if 0 - edict_t *tempent; - /* - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, -8); - */ - - // Jorg is on modelindex2. Do not clear him. - VectorSet(self->mins, -60, -60, 0); - VectorSet(self->maxs, 60, 60, 72); - self->movetype = MOVETYPE_TOSS; - self->nextthink = 0; - gi.linkentity(self); - - tempent = G_Spawn(); - VectorCopy(self->s.origin, tempent->s.origin); - VectorCopy(self->s.angles, tempent->s.angles); - tempent->killtarget = self->killtarget; - tempent->target = self->target; - tempent->activator = self->enemy; - self->killtarget = 0; - self->target = 0; - SP_monster_makron(tempent); -#endif } diff --git a/src/baseq2/m_brain.c b/src/baseq2/m_brain.c index e29344d56..284f20916 100644 --- a/src/baseq2/m_brain.c +++ b/src/baseq2/m_brain.c @@ -169,70 +169,8 @@ mframe_t brain_frames_walk1 [] = { }; mmove_t brain_move_walk1 = {FRAME_walk101, FRAME_walk111, brain_frames_walk1, NULL}; -// walk2 is FUBAR, do not use -#if 0 -void brain_walk2_cycle(edict_t *self) -{ - if (random() > 0.1f) - self->monsterinfo.nextframe = FRAME_walk220; -} - -mframe_t brain_frames_walk2 [] = { - { ai_walk, 3, NULL }, - { ai_walk, -2, NULL }, - { ai_walk, -4, NULL }, - { ai_walk, -3, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 1, NULL }, - { ai_walk, 12, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, -3, NULL }, - { ai_walk, 0, NULL }, - - { ai_walk, -2, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 1, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 10, NULL }, // Cycle Start - - { ai_walk, -1, NULL }, - { ai_walk, 7, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 3, NULL }, - { ai_walk, -3, NULL }, - { ai_walk, 2, NULL }, - { ai_walk, 4, NULL }, - { ai_walk, -3, NULL }, - { ai_walk, 2, NULL }, - { ai_walk, 0, NULL }, - - { - ai_walk, 4, brain_walk2_cycle, - { ai_walk, -1, NULL }, - { ai_walk, -1, NULL }, - { ai_walk, -8, NULL }, - { ai_walk, 0, NULL }, - { ai_walk, 1, NULL }, - { ai_walk, 5, NULL }, - { ai_walk, 2, NULL }, - { ai_walk, -1, NULL }, - { - ai_walk, -5, NULL - }; - mmove_t brain_move_walk2 = {FRAME_walk201, FRAME_walk240, brain_frames_walk2, NULL}; - } -#endif - void brain_walk(edict_t *self) { -// if (random() <= 0.5) self->monsterinfo.currentmove = &brain_move_walk1; -// else -// self->monsterinfo.currentmove = &brain_move_walk2; } diff --git a/src/baseq2/m_gunner.c b/src/baseq2/m_gunner.c index f25a40d2f..6504e8a82 100644 --- a/src/baseq2/m_gunner.c +++ b/src/baseq2/m_gunner.c @@ -458,16 +458,6 @@ void GunnerGrenade(edict_t *self) } mframe_t gunner_frames_attack_chain [] = { - /* - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - */ { ai_charge, 0, gunner_opengun }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, diff --git a/src/baseq2/m_insane.c b/src/baseq2/m_insane.c index 3a3580a4b..0c001ea48 100644 --- a/src/baseq2/m_insane.c +++ b/src/baseq2/m_insane.c @@ -588,8 +588,6 @@ void insane_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage */ void SP_misc_insane(edict_t *self) { -// static int skin = 0; //@@ - if (deathmatch->value) { G_FreeEdict(self); return; @@ -630,12 +628,6 @@ void SP_misc_insane(edict_t *self) self->monsterinfo.sight = NULL; self->monsterinfo.aiflags |= AI_GOOD_GUY; -//@@ -// self->s.skinnum = skin; -// skin++; -// if (skin > 12) -// skin = 0; - gi.linkentity(self); if (self->spawnflags & 16) // Stand Ground diff --git a/src/baseq2/m_parasite.c b/src/baseq2/m_parasite.c index 3730f01fb..d52e12bbe 100644 --- a/src/baseq2/m_parasite.c +++ b/src/baseq2/m_parasite.c @@ -367,54 +367,8 @@ mframe_t parasite_frames_drain [] = { }; mmove_t parasite_move_drain = {FRAME_drain01, FRAME_drain18, parasite_frames_drain, parasite_start_run}; -#if 0 -mframe_t parasite_frames_break [] = { - { ai_charge, 0, NULL }, - { ai_charge, -3, NULL }, - { ai_charge, 1, NULL }, - { ai_charge, 2, NULL }, - { ai_charge, -3, NULL }, - { ai_charge, 1, NULL }, - { ai_charge, 1, NULL }, - { ai_charge, 3, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, -18, NULL }, - { ai_charge, 3, NULL }, - { ai_charge, 9, NULL }, - { ai_charge, 6, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, -18, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 8, NULL }, - { ai_charge, 9, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, -18, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, // airborne - { ai_charge, 0, NULL }, // airborne - { ai_charge, 0, NULL }, // slides - { ai_charge, 0, NULL }, // slides - { ai_charge, 0, NULL }, // slides - { ai_charge, 0, NULL }, // slides - { ai_charge, 4, NULL }, - { ai_charge, 11, NULL }, - { ai_charge, -2, NULL }, - { ai_charge, -5, NULL }, - { ai_charge, 1, NULL } -}; -mmove_t parasite_move_break = {FRAME_break01, FRAME_break32, parasite_frames_break, parasite_start_run}; -#endif -/* -=== -Break Stuff Ends -=== -*/ - void parasite_attack(edict_t *self) { -// if (random() <= 0.2) -// self->monsterinfo.currentmove = ¶site_move_break; -// else self->monsterinfo.currentmove = ¶site_move_drain; } diff --git a/src/baseq2/m_soldier.c b/src/baseq2/m_soldier.c index 3879c8a02..496135feb 100644 --- a/src/baseq2/m_soldier.c +++ b/src/baseq2/m_soldier.c @@ -140,69 +140,6 @@ mframe_t soldier_frames_stand3 [] = { }; mmove_t soldier_move_stand3 = {FRAME_stand301, FRAME_stand339, soldier_frames_stand3, soldier_stand}; -#if 0 -mframe_t soldier_frames_stand4 [] = { - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL }, - { ai_stand, 4, NULL }, - { ai_stand, 1, NULL }, - { ai_stand, -1, NULL }, - { ai_stand, -2, NULL }, - - { ai_stand, 0, NULL }, - { ai_stand, 0, NULL } -}; -mmove_t soldier_move_stand4 = {FRAME_stand401, FRAME_stand452, soldier_frames_stand4, NULL}; -#endif - void soldier_stand(edict_t *self) { if ((self->monsterinfo.currentmove == &soldier_move_stand3) || (random() < 0.8f)) @@ -651,12 +588,6 @@ mmove_t soldier_move_attack3 = {FRAME_attak301, FRAME_attak309, soldier_frames_a void soldier_fire4(edict_t *self) { soldier_fire(self, 3); -// -// if (self->enemy->health <= 0) -// return; -// -// if ( ((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE) ) -// self->monsterinfo.nextframe = FRAME_attak402; } mframe_t soldier_frames_attack4 [] = { @@ -669,36 +600,6 @@ mframe_t soldier_frames_attack4 [] = { }; mmove_t soldier_move_attack4 = {FRAME_attak401, FRAME_attak406, soldier_frames_attack4, soldier_run}; -#if 0 -// ATTACK5 (prone) - -void soldier_fire5(edict_t *self) -{ - soldier_fire(self, 4); -} - -void soldier_attack5_refire(edict_t *self) -{ - if (self->enemy->health <= 0) - return; - - if (((skill->value == 3) && (random() < 0.5f)) || (range(self, self->enemy) == RANGE_MELEE)) - self->monsterinfo.nextframe = FRAME_attak505; -} - -mframe_t soldier_frames_attack5 [] = { - { ai_charge, 8, NULL }, - { ai_charge, 8, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, soldier_fire5 }, - { ai_charge, 0, NULL }, - { ai_charge, 0, NULL }, - { ai_charge, 0, soldier_attack5_refire } -}; -mmove_t soldier_move_attack5 = {FRAME_attak501, FRAME_attak508, soldier_frames_attack5, soldier_run}; -#endif - // ATTACK6 (run & shoot) void soldier_fire8(edict_t *self) diff --git a/src/baseq2/m_supertank.c b/src/baseq2/m_supertank.c index ba891df4f..da2d57990 100644 --- a/src/baseq2/m_supertank.c +++ b/src/baseq2/m_supertank.c @@ -529,16 +529,10 @@ void supertank_attack(edict_t *self) { vec3_t vec; float range; - //float r; VectorSubtract(self->enemy->s.origin, self->s.origin, vec); range = VectorLength(vec); - //r = random(); - - // Attack 1 == Chaingun - // Attack 2 == Rocket Launcher - if (range <= 160) { self->monsterinfo.currentmove = &supertank_move_attack1; } else { From 45ceb16b878f9a63c3edfd25fad73ac8c5a6ed4c Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sat, 11 Mar 2023 00:21:21 +0300 Subject: [PATCH 04/15] Convert itemlist[] to designated initializers. --- src/baseq2/g_items.c | 1264 +++++++++++++++++------------------------- 1 file changed, 506 insertions(+), 758 deletions(-) diff --git a/src/baseq2/g_items.c b/src/baseq2/g_items.c index 82d690310..a99e87848 100644 --- a/src/baseq2/g_items.c +++ b/src/baseq2/g_items.c @@ -1069,140 +1069,99 @@ gitem_t itemlist[] = { /*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_armor_body", - Pickup_Armor, - NULL, - NULL, - NULL, - "misc/ar1_pkup.wav", - "models/items/armor/body/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_bodyarmor", - /* pickup */ "Body Armor", - /* width */ 3, - 0, - NULL, - IT_ARMOR, - 0, - &bodyarmor_info, - ARMOR_BODY, - /* precache */ "" + .classname = "item_armor_body", + .pickup = Pickup_Armor, + .pickup_sound = "misc/ar1_pkup.wav", + .world_model = "models/items/armor/body/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_bodyarmor", + .pickup_name = "Body Armor", + .count_width = 3, + .flags = IT_ARMOR, + .info = &bodyarmor_info, + .tag = ARMOR_BODY, }, /*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_armor_combat", - Pickup_Armor, - NULL, - NULL, - NULL, - "misc/ar1_pkup.wav", - "models/items/armor/combat/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_combatarmor", - /* pickup */ "Combat Armor", - /* width */ 3, - 0, - NULL, - IT_ARMOR, - 0, - &combatarmor_info, - ARMOR_COMBAT, - /* precache */ "" + .classname = "item_armor_combat", + .pickup = Pickup_Armor, + .pickup_sound = "misc/ar1_pkup.wav", + .world_model = "models/items/armor/combat/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_combatarmor", + .pickup_name = "Combat Armor", + .count_width = 3, + .flags = IT_ARMOR, + .info = &combatarmor_info, + .tag = ARMOR_COMBAT, }, /*QUAKED item_armor_jacket (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_armor_jacket", - Pickup_Armor, - NULL, - NULL, - NULL, - "misc/ar1_pkup.wav", - "models/items/armor/jacket/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_jacketarmor", - /* pickup */ "Jacket Armor", - /* width */ 3, - 0, - NULL, - IT_ARMOR, - 0, - &jacketarmor_info, - ARMOR_JACKET, - /* precache */ "" + .classname = "item_armor_jacket", + .pickup = Pickup_Armor, + .pickup_sound = "misc/ar1_pkup.wav", + .world_model = "models/items/armor/jacket/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_jacketarmor", + .pickup_name = "Jacket Armor", + .count_width = 3, + .flags = IT_ARMOR, + .info = &jacketarmor_info, + .tag = ARMOR_JACKET, }, /*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_armor_shard", - Pickup_Armor, - NULL, - NULL, - NULL, - "misc/ar2_pkup.wav", - "models/items/armor/shard/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_jacketarmor", - /* pickup */ "Armor Shard", - /* width */ 3, - 0, - NULL, - IT_ARMOR, - 0, - NULL, - ARMOR_SHARD, - /* precache */ "" + .classname = "item_armor_shard", + .pickup = Pickup_Armor, + .pickup_sound = "misc/ar2_pkup.wav", + .world_model = "models/items/armor/shard/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_jacketarmor", + .pickup_name = "Armor Shard", + .count_width = 3, + .flags = IT_ARMOR, + .tag = ARMOR_SHARD, }, /*QUAKED item_power_screen (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_power_screen", - Pickup_PowerArmor, - Use_PowerArmor, - Drop_PowerArmor, - NULL, - "misc/ar3_pkup.wav", - "models/items/armor/screen/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_powerscreen", - /* pickup */ "Power Screen", - /* width */ 0, - 60, - NULL, - IT_ARMOR, - 0, - NULL, - 0, - /* precache */ "" + .classname = "item_power_screen", + .pickup = Pickup_PowerArmor, + .use = Use_PowerArmor, + .drop = Drop_PowerArmor, + .pickup_sound = "misc/ar3_pkup.wav", + .world_model = "models/items/armor/screen/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_powerscreen", + .pickup_name = "Power Screen", + .quantity = 60, + .flags = IT_ARMOR, + .precaches = "misc/power1.wav misc/power2.wav", }, /*QUAKED item_power_shield (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_power_shield", - Pickup_PowerArmor, - Use_PowerArmor, - Drop_PowerArmor, - NULL, - "misc/ar3_pkup.wav", - "models/items/armor/shield/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_powershield", - /* pickup */ "Power Shield", - /* width */ 0, - 60, - NULL, - IT_ARMOR, - 0, - NULL, - 0, - /* precache */ "misc/power2.wav misc/power1.wav" + .classname = "item_power_shield", + .pickup = Pickup_PowerArmor, + .use = Use_PowerArmor, + .drop = Drop_PowerArmor, + .pickup_sound = "misc/ar3_pkup.wav", + .world_model = "models/items/armor/shield/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_powershield", + .pickup_name = "Power Shield", + .quantity = 60, + .flags = IT_ARMOR, + .precaches = "misc/power1.wav misc/power2.wav", }, @@ -1214,277 +1173,247 @@ gitem_t itemlist[] = { always owned, never in the world */ { - "weapon_blaster", - NULL, - Use_Weapon, - NULL, - Weapon_Blaster, - "misc/w_pkup.wav", - NULL, 0, - "models/weapons/v_blast/tris.md2", - /* icon */ "w_blaster", - /* pickup */ "Blaster", - 0, - 0, - NULL, - IT_WEAPON | IT_STAY_COOP, - WEAP_BLASTER, - NULL, - 0, - /* precache */ "models/objects/laser/tris.md2 weapons/blastf1a.wav misc/lasfly.wav" + .classname = "weapon_blaster", + .use = Use_Weapon, + .weaponthink = Weapon_Blaster, + .pickup_sound = "misc/w_pkup.wav", + .view_model = "models/weapons/v_blast/tris.md2", + .icon = "w_blaster", + .pickup_name = "Blaster", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_BLASTER, + .precaches = "models/objects/laser/tris.md2 weapons/blastf1a.wav misc/lasfly.wav", }, /*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_shotgun", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_Shotgun, - "misc/w_pkup.wav", - "models/weapons/g_shotg/tris.md2", EF_ROTATE, - "models/weapons/v_shotg/tris.md2", - /* icon */ "w_shotgun", - /* pickup */ "Shotgun", - 0, - 1, - "Shells", - IT_WEAPON | IT_STAY_COOP, - WEAP_SHOTGUN, - NULL, - 0, - /* precache */ "weapons/shotgf1b.wav weapons/shotgr1b.wav" + .classname = "weapon_shotgun", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_Shotgun, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_shotg/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_shotg/tris.md2", + .icon = "w_shotgun", + .pickup_name = "Shotgun", + .quantity = 1, + .ammo = "Shells", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_SHOTGUN, + .precaches = "weapons/shotgf1b.wav weapons/shotgr1b.wav", }, /*QUAKED weapon_supershotgun (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_supershotgun", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_SuperShotgun, - "misc/w_pkup.wav", - "models/weapons/g_shotg2/tris.md2", EF_ROTATE, - "models/weapons/v_shotg2/tris.md2", - /* icon */ "w_sshotgun", - /* pickup */ "Super Shotgun", - 0, - 2, - "Shells", - IT_WEAPON | IT_STAY_COOP, - WEAP_SUPERSHOTGUN, - NULL, - 0, - /* precache */ "weapons/sshotf1b.wav" + .classname = "weapon_supershotgun", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_SuperShotgun, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_shotg2/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_shotg2/tris.md2", + .icon = "w_sshotgun", + .pickup_name = "Super Shotgun", + .quantity = 2, + .ammo = "Shells", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_SUPERSHOTGUN, + .precaches = "weapons/sshotf1b.wav" }, /*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_machinegun", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_Machinegun, - "misc/w_pkup.wav", - "models/weapons/g_machn/tris.md2", EF_ROTATE, - "models/weapons/v_machn/tris.md2", - /* icon */ "w_machinegun", - /* pickup */ "Machinegun", - 0, - 1, - "Bullets", - IT_WEAPON | IT_STAY_COOP, - WEAP_MACHINEGUN, - NULL, - 0, - /* precache */ "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav" + .classname = "weapon_machinegun", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_Machinegun, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_machn/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_machn/tris.md2", + .icon = "w_machinegun", + .pickup_name = "Machinegun", + .quantity = 1, + .ammo = "Bullets", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_MACHINEGUN, + .precaches = "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav", }, /*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_chaingun", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_Chaingun, - "misc/w_pkup.wav", - "models/weapons/g_chain/tris.md2", EF_ROTATE, - "models/weapons/v_chain/tris.md2", - /* icon */ "w_chaingun", - /* pickup */ "Chaingun", - 0, - 1, - "Bullets", - IT_WEAPON | IT_STAY_COOP, - WEAP_CHAINGUN, - NULL, - 0, - /* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav weapons/chngnd1a.wav" + .classname = "weapon_chaingun", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_Chaingun, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_chain/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_chain/tris.md2", + .icon = "w_chaingun", + .pickup_name = "Chaingun", + .quantity = 1, + .ammo = "Bullets", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_CHAINGUN, + .precaches = "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/chngnd1a.wav", }, /*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "ammo_grenades", - Pickup_Ammo, - Use_Weapon, - Drop_Ammo, - Weapon_Grenade, - "misc/am_pkup.wav", - "models/items/ammo/grenades/medium/tris.md2", 0, - "models/weapons/v_handgr/tris.md2", - /* icon */ "a_grenades", - /* pickup */ "Grenades", - /* width */ 3, - 5, - "grenades", - IT_AMMO | IT_WEAPON, - WEAP_GRENADES, - NULL, - AMMO_GRENADES, - /* precache */ "models/objects/grenade2/tris.md2 weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav" + .classname = "ammo_grenades", + .pickup = Pickup_Ammo, + .use = Use_Weapon, + .drop = Drop_Ammo, + .weaponthink = Weapon_Grenade, + .pickup_sound = "misc/am_pkup.wav", + .world_model = "models/items/ammo/grenades/medium/tris.md2", + .view_model = "models/weapons/v_handgr/tris.md2", + .icon = "a_grenades", + .pickup_name = "Grenades", + .count_width = 3, + .quantity = 5, + .ammo = "grenades", + .flags = IT_AMMO | IT_WEAPON, + .weapmodel = WEAP_GRENADES, + .tag = AMMO_GRENADES, + .precaches = "models/objects/grenade2/tris.md2 weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav", }, /*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_grenadelauncher", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_GrenadeLauncher, - "misc/w_pkup.wav", - "models/weapons/g_launch/tris.md2", EF_ROTATE, - "models/weapons/v_launch/tris.md2", - /* icon */ "w_glauncher", - /* pickup */ "Grenade Launcher", - 0, - 1, - "Grenades", - IT_WEAPON | IT_STAY_COOP, - WEAP_GRENADELAUNCHER, - NULL, - 0, - /* precache */ "models/objects/grenade/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav" + .classname = "weapon_grenadelauncher", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_GrenadeLauncher, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_launch/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_launch/tris.md2", + .icon = "w_glauncher", + .pickup_name = "Grenade Launcher", + .quantity = 1, + .ammo = "Grenades", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_GRENADELAUNCHER, + .precaches = "models/objects/grenade/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav", }, /*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_rocketlauncher", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_RocketLauncher, - "misc/w_pkup.wav", - "models/weapons/g_rocket/tris.md2", EF_ROTATE, - "models/weapons/v_rocket/tris.md2", - /* icon */ "w_rlauncher", - /* pickup */ "Rocket Launcher", - 0, - 1, - "Rockets", - IT_WEAPON | IT_STAY_COOP, - WEAP_ROCKETLAUNCHER, - NULL, - 0, - /* precache */ "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2" + .classname = "weapon_rocketlauncher", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_RocketLauncher, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_rocket/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_rocket/tris.md2", + .icon = "w_rlauncher", + .pickup_name = "Rocket Launcher", + .quantity = 1, + .ammo = "Rockets", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_ROCKETLAUNCHER, + .precaches = "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2", }, /*QUAKED weapon_hyperblaster (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_hyperblaster", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_HyperBlaster, - "misc/w_pkup.wav", - "models/weapons/g_hyperb/tris.md2", EF_ROTATE, - "models/weapons/v_hyperb/tris.md2", - /* icon */ "w_hyperblaster", - /* pickup */ "HyperBlaster", - 0, - 1, - "Cells", - IT_WEAPON | IT_STAY_COOP, - WEAP_HYPERBLASTER, - NULL, - 0, - /* precache */ "models/objects/laser/tris.md2 weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav" + .classname = "weapon_hyperblaster", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_HyperBlaster, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_hyperb/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_hyperb/tris.md2", + .icon = "w_hyperblaster", + .pickup_name = "HyperBlaster", + .quantity = 1, + .ammo = "Cells", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_HYPERBLASTER, + .precaches = "models/objects/laser/tris.md2 weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav", }, /*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_railgun", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_Railgun, - "misc/w_pkup.wav", - "models/weapons/g_rail/tris.md2", EF_ROTATE, - "models/weapons/v_rail/tris.md2", - /* icon */ "w_railgun", - /* pickup */ "Railgun", - 0, - 1, - "Slugs", - IT_WEAPON | IT_STAY_COOP, - WEAP_RAILGUN, - NULL, - 0, - /* precache */ "weapons/rg_hum.wav" + .classname = "weapon_railgun", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_Railgun, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_rail/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_rail/tris.md2", + .icon = "w_railgun", + .pickup_name = "Railgun", + .quantity = 1, + .ammo = "Slugs", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_RAILGUN, + .precaches = "weapons/railgf1a.wav weapons/rg_hum.wav", }, /*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "weapon_bfg", - Pickup_Weapon, - Use_Weapon, - Drop_Weapon, - Weapon_BFG, - "misc/w_pkup.wav", - "models/weapons/g_bfg/tris.md2", EF_ROTATE, - "models/weapons/v_bfg/tris.md2", - /* icon */ "w_bfg", - /* pickup */ "BFG10K", - 0, - 50, - "Cells", - IT_WEAPON | IT_STAY_COOP, - WEAP_BFG, - NULL, - 0, - /* precache */ "sprites/s_bfg1.sp2 sprites/s_bfg2.sp2 sprites/s_bfg3.sp2 weapons/bfg__f1y.wav weapons/bfg__l1a.wav weapons/bfg__x1b.wav weapons/bfg_hum.wav" + .classname = "weapon_bfg", + .pickup = Pickup_Weapon, + .use = Use_Weapon, + .drop = Drop_Weapon, + .weaponthink = Weapon_BFG, + .pickup_sound = "misc/w_pkup.wav", + .world_model = "models/weapons/g_bfg/tris.md2", + .world_model_flags = EF_ROTATE, + .view_model = "models/weapons/v_bfg/tris.md2", + .icon = "w_bfg", + .pickup_name = "BFG10K", + .quantity = 50, + .ammo = "Cells", + .flags = IT_WEAPON | IT_STAY_COOP, + .weapmodel = WEAP_BFG, + .precaches = "sprites/s_bfg1.sp2 sprites/s_bfg2.sp2 sprites/s_bfg3.sp2 weapons/bfg__f1y.wav weapons/bfg__l1a.wav weapons/bfg__x1b.wav weapons/bfg_hum.wav", }, /*QUAKED weapon_flaregun (.3 .3 1) (-16 -16 -16) (16 16 16)*/ { - "weapon_flaregun", // class name - Pickup_Weapon, // Function to use to pickup weapon - Use_Weapon, // Function to use to use weapon - Drop_Weapon, // Function to use to drop weapon - Weapon_FlareGun, // Function called every frame this weapon is active - "misc/w_pkup.wav",// Sound to play when picked up - "models/weapons/g_flareg/tris.md2", // Item model for placement on maps - EF_ROTATE,//Flags - "models/weapons/v_flareg/tris.md3",//Model player sees - "w_flareg", //name of item icon in item list (minus .pcx) - "Flare Gun", //Item name (ie use flare gun) - 0, // Count width (for timed things like quad) - 1, // Ammo per shot - "Grenades", // Type of ammo to use - IT_WEAPON, // IT_WEAPON, IT_ARMOR, or IT_AMMO - WEAP_FLAREGUN, - NULL, // userinfo? (void*) - 0, // tag - "" //things to precache + .classname = "weapon_flaregun", // class name + .pickup = Pickup_Weapon, // Function to use to pickup weapon + .use = Use_Weapon, // Function to use to use weapon + .drop = Drop_Weapon, // Function to use to drop weapon + .weaponthink = Weapon_FlareGun, // Function called every frame this weapon is active + .pickup_sound = "misc/w_pkup.wav",// Sound to play when picked up + .world_model = "models/weapons/g_flareg/tris.md2", // Item model for placement on maps + .world_model_flags = EF_ROTATE,//Flags + .view_model = "models/weapons/v_flareg/tris.md3",//Model player sees + .icon = "w_flareg", //name of item icon in item list (minus .pcx) + .pickup_name = "Flare Gun", //Item name (ie use flare gun) + .quantity = 1, // Ammo per shot + .ammo = "Grenades", // Type of ammo to use + .flags = IT_WEAPON, // IT_WEAPON, IT_ARMOR, or IT_AMMO + .weapmodel = WEAP_FLAREGUN, + .precaches = "" //things to precache }, // // AMMO ITEMS @@ -1493,116 +1422,81 @@ gitem_t itemlist[] = { /*QUAKED ammo_shells (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "ammo_shells", - Pickup_Ammo, - NULL, - Drop_Ammo, - NULL, - "misc/am_pkup.wav", - "models/items/ammo/shells/medium/tris.md2", 0, - NULL, - /* icon */ "a_shells", - /* pickup */ "Shells", - /* width */ 3, - 10, - NULL, - IT_AMMO, - 0, - NULL, - AMMO_SHELLS, - /* precache */ "" + .classname = "ammo_shells", + .pickup = Pickup_Ammo, + .drop = Drop_Ammo, + .pickup_sound = "misc/am_pkup.wav", + .world_model = "models/items/ammo/shells/medium/tris.md2", + .icon = "a_shells", + .pickup_name = "Shells", + .count_width = 3, + .quantity = 10, + .flags = IT_AMMO, + .tag = AMMO_SHELLS, }, /*QUAKED ammo_bullets (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "ammo_bullets", - Pickup_Ammo, - NULL, - Drop_Ammo, - NULL, - "misc/am_pkup.wav", - "models/items/ammo/bullets/medium/tris.md2", 0, - NULL, - /* icon */ "a_bullets", - /* pickup */ "Bullets", - /* width */ 3, - 50, - NULL, - IT_AMMO, - 0, - NULL, - AMMO_BULLETS, - /* precache */ "" + .classname = "ammo_bullets", + .pickup = Pickup_Ammo, + .drop = Drop_Ammo, + .pickup_sound = "misc/am_pkup.wav", + .world_model = "models/items/ammo/bullets/medium/tris.md2", + .icon = "a_bullets", + .pickup_name = "Bullets", + .count_width = 3, + .quantity = 50, + .flags = IT_AMMO, + .tag = AMMO_BULLETS, }, /*QUAKED ammo_cells (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "ammo_cells", - Pickup_Ammo, - NULL, - Drop_Ammo, - NULL, - "misc/am_pkup.wav", - "models/items/ammo/cells/medium/tris.md2", 0, - NULL, - /* icon */ "a_cells", - /* pickup */ "Cells", - /* width */ 3, - 50, - NULL, - IT_AMMO, - 0, - NULL, - AMMO_CELLS, - /* precache */ "" + .classname = "ammo_cells", + .pickup = Pickup_Ammo, + .drop = Drop_Ammo, + .pickup_sound = "misc/am_pkup.wav", + .world_model = "models/items/ammo/cells/medium/tris.md2", + .icon = "a_cells", + .pickup_name = "Cells", + .count_width = 3, + .quantity = 50, + .flags = IT_AMMO, + .tag = AMMO_CELLS, }, /*QUAKED ammo_rockets (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "ammo_rockets", - Pickup_Ammo, - NULL, - Drop_Ammo, - NULL, - "misc/am_pkup.wav", - "models/items/ammo/rockets/medium/tris.md2", 0, - NULL, - /* icon */ "a_rockets", - /* pickup */ "Rockets", - /* width */ 3, - 5, - NULL, - IT_AMMO, - 0, - NULL, - AMMO_ROCKETS, - /* precache */ "" + .classname = "ammo_rockets", + .pickup = Pickup_Ammo, + .drop = Drop_Ammo, + .pickup_sound = "misc/am_pkup.wav", + .world_model = "models/items/ammo/rockets/medium/tris.md2", + .icon = "a_rockets", + .pickup_name = "Rockets", + .count_width = 3, + .quantity = 5, + .flags = IT_AMMO, + .tag = AMMO_ROCKETS, }, /*QUAKED ammo_slugs (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "ammo_slugs", - Pickup_Ammo, - NULL, - Drop_Ammo, - NULL, - "misc/am_pkup.wav", - "models/items/ammo/slugs/medium/tris.md2", 0, - NULL, - /* icon */ "a_slugs", - /* pickup */ "Slugs", - /* width */ 3, - 10, - NULL, - IT_AMMO, - 0, - NULL, - AMMO_SLUGS, - /* precache */ "" + .classname = "ammo_slugs", + .pickup = Pickup_Ammo, + .drop = Drop_Ammo, + .pickup_sound = "misc/am_pkup.wav", + .world_model = "models/items/ammo/slugs/medium/tris.md2", + .icon = "a_slugs", + .pickup_name = "Slugs", + .count_width = 3, + .quantity = 10, + .flags = IT_AMMO, + .tag = AMMO_SLUGS, }, @@ -1612,210 +1506,148 @@ gitem_t itemlist[] = { /*QUAKED item_quad (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_quad", - Pickup_Powerup, - Use_Quad, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/quaddama/tris.md2", EF_ROTATE, - NULL, - /* icon */ "p_quad", - /* pickup */ "Quad Damage", - /* width */ 2, - 60, - NULL, - IT_POWERUP, - 0, - NULL, - 0, - /* precache */ "items/damage.wav items/damage2.wav items/damage3.wav" + .classname = "item_quad", + .pickup = Pickup_Powerup, + .use = Use_Quad, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/quaddama/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "p_quad", + .pickup_name = "Quad Damage", + .count_width = 2, + .quantity = 60, + .flags = IT_POWERUP, + .precaches = "items/damage.wav items/damage2.wav items/damage3.wav", }, /*QUAKED item_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_invulnerability", - Pickup_Powerup, - Use_Invulnerability, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/invulner/tris.md2", EF_ROTATE, - NULL, - /* icon */ "p_invulnerability", - /* pickup */ "Invulnerability", - /* width */ 2, - 300, - NULL, - IT_POWERUP, - 0, - NULL, - 0, - /* precache */ "items/protect.wav items/protect2.wav items/protect4.wav" + .classname = "item_invulnerability", + .pickup = Pickup_Powerup, + .use = Use_Invulnerability, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/invulner/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "p_invulnerability", + .pickup_name = "Invulnerability", + .count_width = 2, + .quantity = 300, + .flags = IT_POWERUP, + .precaches = "items/protect.wav items/protect2.wav items/protect4.wav", }, /*QUAKED item_silencer (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_silencer", - Pickup_Powerup, - Use_Silencer, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/silencer/tris.md2", EF_ROTATE, - NULL, - /* icon */ "p_silencer", - /* pickup */ "Silencer", - /* width */ 2, - 60, - NULL, - IT_POWERUP, - 0, - NULL, - 0, - /* precache */ "" + .classname = "item_silencer", + .pickup = Pickup_Powerup, + .use = Use_Silencer, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/silencer/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "p_silencer", + .pickup_name = "Silencer", + .count_width = 2, + .quantity = 60, + .flags = IT_POWERUP, }, /*QUAKED item_breather (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_breather", - Pickup_Powerup, - Use_Breather, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/breather/tris.md2", EF_ROTATE, - NULL, - /* icon */ "p_rebreather", - /* pickup */ "Rebreather", - /* width */ 2, - 60, - NULL, - IT_STAY_COOP | IT_POWERUP, - 0, - NULL, - 0, - /* precache */ "items/airout.wav" + .classname = "item_breather", + .pickup = Pickup_Powerup, + .use = Use_Breather, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/breather/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "p_rebreather", + .pickup_name = "Rebreather", + .count_width = 2, + .quantity = 60, + .flags = IT_STAY_COOP | IT_POWERUP, + .precaches = "items/airout.wav", }, /*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_enviro", - Pickup_Powerup, - Use_Envirosuit, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/enviro/tris.md2", EF_ROTATE, - NULL, - /* icon */ "p_envirosuit", - /* pickup */ "Environment Suit", - /* width */ 2, - 60, - NULL, - IT_STAY_COOP | IT_POWERUP, - 0, - NULL, - 0, - /* precache */ "items/airout.wav" + .classname = "item_enviro", + .pickup = Pickup_Powerup, + .use = Use_Envirosuit, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/enviro/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "p_envirosuit", + .pickup_name = "Environment Suit", + .count_width = 2, + .quantity = 60, + .flags = IT_STAY_COOP | IT_POWERUP, + .precaches = "items/airout.wav", }, /*QUAKED item_ancient_head (.3 .3 1) (-16 -16 -16) (16 16 16) Special item that gives +2 to maximum health */ { - "item_ancient_head", - Pickup_AncientHead, - NULL, - NULL, - NULL, - "items/pkup.wav", - "models/items/c_head/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_fixme", - /* pickup */ "Ancient Head", - /* width */ 2, - 60, - NULL, - 0, - 0, - NULL, - 0, - /* precache */ "" + .classname = "item_ancient_head", + .pickup = Pickup_AncientHead, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/c_head/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_fixme", + .pickup_name = "Ancient Head", + .count_width = 2, + .quantity = 60, }, /*QUAKED item_adrenaline (.3 .3 1) (-16 -16 -16) (16 16 16) gives +1 to maximum health */ { - "item_adrenaline", - Pickup_Adrenaline, - NULL, - NULL, - NULL, - "items/pkup.wav", - "models/items/adrenal/tris.md2", EF_ROTATE, - NULL, - /* icon */ "p_adrenaline", - /* pickup */ "Adrenaline", - /* width */ 2, - 60, - NULL, - 0, - 0, - NULL, - 0, - /* precache */ "" + .classname = "item_adrenaline", + .pickup = Pickup_Adrenaline, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/adrenal/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "p_adrenaline", + .pickup_name = "Adrenaline", + .count_width = 2, + .quantity = 60, }, /*QUAKED item_bandolier (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_bandolier", - Pickup_Bandolier, - NULL, - NULL, - NULL, - "items/pkup.wav", - "models/items/band/tris.md2", EF_ROTATE, - NULL, - /* icon */ "p_bandolier", - /* pickup */ "Bandolier", - /* width */ 2, - 60, - NULL, - 0, - 0, - NULL, - 0, - /* precache */ "" + .classname = "item_bandolier", + .pickup = Pickup_Bandolier, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/band/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "p_bandolier", + .pickup_name = "Bandolier", + .count_width = 2, + .quantity = 60, }, /*QUAKED item_pack (.3 .3 1) (-16 -16 -16) (16 16 16) */ { - "item_pack", - Pickup_Pack, - NULL, - NULL, - NULL, - "items/pkup.wav", - "models/items/pack/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_pack", - /* pickup */ "Ammo Pack", - /* width */ 2, - 180, - NULL, - 0, - 0, - NULL, - 0, - /* precache */ "" + .classname = "item_pack", + .pickup = Pickup_Pack, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/pack/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_pack", + .pickup_name = "Ammo Pack", + .count_width = 2, + .quantity = 180, }, // @@ -1825,241 +1657,157 @@ gitem_t itemlist[] = { key for computer centers */ { - "key_data_cd", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/data_cd/tris.md2", EF_ROTATE, - NULL, - "k_datacd", - "Data CD", - 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_data_cd", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/data_cd/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "k_datacd", + .pickup_name = "Data CD", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_power_cube (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN NO_TOUCH warehouse circuits */ { - "key_power_cube", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/power/tris.md2", EF_ROTATE, - NULL, - "k_powercube", - "Power Cube", - 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_power_cube", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/power/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "k_powercube", + .pickup_name = "Power Cube", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_pyramid (0 .5 .8) (-16 -16 -16) (16 16 16) key for the entrance of jail3 */ { - "key_pyramid", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/pyramid/tris.md2", EF_ROTATE, - NULL, - "k_pyramid", - "Pyramid Key", - 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_pyramid", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/pyramid/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "k_pyramid", + .pickup_name = "Pyramid Key", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_data_spinner (0 .5 .8) (-16 -16 -16) (16 16 16) key for the city computer */ { - "key_data_spinner", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/spinner/tris.md2", EF_ROTATE, - NULL, - "k_dataspin", - "Data Spinner", - 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_data_spinner", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/spinner/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "k_dataspin", + .pickup_name = "Data Spinner", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_pass (0 .5 .8) (-16 -16 -16) (16 16 16) security pass for the security level */ { - "key_pass", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/pass/tris.md2", EF_ROTATE, - NULL, - "k_security", - "Security Pass", - 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_pass", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/pass/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "k_security", + .pickup_name = "Security Pass", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_blue_key (0 .5 .8) (-16 -16 -16) (16 16 16) normal door key - blue */ { - "key_blue_key", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/key/tris.md2", EF_ROTATE, - NULL, - "k_bluekey", - "Blue Key", - 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_blue_key", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/key/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "k_bluekey", + .pickup_name = "Blue Key", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_red_key (0 .5 .8) (-16 -16 -16) (16 16 16) normal door key - red */ { - "key_red_key", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/red_key/tris.md2", EF_ROTATE, - NULL, - "k_redkey", - "Red Key", - 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_red_key", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/red_key/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "k_redkey", + .pickup_name = "Red Key", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_commander_head (0 .5 .8) (-16 -16 -16) (16 16 16) tank commander's head */ { - "key_commander_head", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/monsters/commandr/head/tris.md2", EF_GIB, - NULL, - /* icon */ "k_comhead", - /* pickup */ "Commander's Head", - /* width */ 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_commander_head", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/monsters/commandr/head/tris.md2", + .world_model_flags = EF_GIB, + .icon = "k_comhead", + .pickup_name = "Commander's Head", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, /*QUAKED key_airstrike_target (0 .5 .8) (-16 -16 -16) (16 16 16) tank commander's head */ { - "key_airstrike_target", - Pickup_Key, - NULL, - Drop_General, - NULL, - "items/pkup.wav", - "models/items/keys/target/tris.md2", EF_ROTATE, - NULL, - /* icon */ "i_airstrike", - /* pickup */ "Airstrike Marker", - /* width */ 2, - 0, - NULL, - IT_STAY_COOP | IT_KEY, - 0, - NULL, - 0, - /* precache */ "" + .classname = "key_airstrike_target", + .pickup = Pickup_Key, + .drop = Drop_General, + .pickup_sound = "items/pkup.wav", + .world_model = "models/items/keys/target/tris.md2", + .world_model_flags = EF_ROTATE, + .icon = "i_airstrike", + .pickup_name = "Airstrike Marker", + .count_width = 2, + .flags = IT_STAY_COOP | IT_KEY, }, { - NULL, - Pickup_Health, - NULL, - NULL, - NULL, - "items/pkup.wav", - NULL, 0, - NULL, - /* icon */ "i_health", - /* pickup */ "Health", - /* width */ 3, - 0, - NULL, - 0, - 0, - NULL, - 0, - /* precache */ "items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav" + .pickup = Pickup_Health, + .pickup_sound = "items/pkup.wav", + .icon = "i_health", + .pickup_name = "Health", + .count_width = 3, + .precaches = "items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav", }, // end of list marker - {NULL} + { NULL } }; From ca3d06b3dd93af2eebd854e02dc6a5362de96257 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sat, 11 Mar 2023 19:06:03 +0300 Subject: [PATCH 05/15] Convert precache strings into arrays. --- src/baseq2/g_items.c | 163 +++++++++++++++++++++++++++++++++---------- src/baseq2/g_local.h | 2 +- 2 files changed, 129 insertions(+), 36 deletions(-) diff --git a/src/baseq2/g_items.c b/src/baseq2/g_items.c index a99e87848..995011482 100644 --- a/src/baseq2/g_items.c +++ b/src/baseq2/g_items.c @@ -933,10 +933,9 @@ and for each item in each client's inventory. */ void PrecacheItem(gitem_t *it) { - char *s, *start; - char data[MAX_QPATH]; - int len; - gitem_t *ammo; + const char *const *s; + const char *data; + size_t len; if (!it) return; @@ -952,28 +951,21 @@ void PrecacheItem(gitem_t *it) // parse everything for its ammo if (it->ammo && it->ammo[0]) { - ammo = FindItem(it->ammo); + gitem_t *ammo = FindItem(it->ammo); if (ammo != it) PrecacheItem(ammo); } - // parse the space seperated precache string for other items + // parse NULL terminated precache list for other items s = it->precaches; - if (!s || !s[0]) + if (!s) return; while (*s) { - start = s; - while (*s && *s != ' ') - s++; - - len = s - start; + data = *s++; + len = strlen(data); if (len >= MAX_QPATH || len < 5) gi.error("PrecacheItem: %s has bad precache string", it->classname); - memcpy(data, start, len); - data[len] = 0; - if (*s) - s++; // determine type based on extension if (!strcmp(data + len - 3, "md2")) @@ -1144,7 +1136,11 @@ gitem_t itemlist[] = { .pickup_name = "Power Screen", .quantity = 60, .flags = IT_ARMOR, - .precaches = "misc/power1.wav misc/power2.wav", + .precaches = (const char *const []) { + "misc/power1.wav", + "misc/power2.wav", + NULL + }, }, /*QUAKED item_power_shield (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1161,7 +1157,11 @@ gitem_t itemlist[] = { .pickup_name = "Power Shield", .quantity = 60, .flags = IT_ARMOR, - .precaches = "misc/power1.wav misc/power2.wav", + .precaches = (const char *const []) { + "misc/power1.wav", + "misc/power2.wav", + NULL + }, }, @@ -1182,7 +1182,12 @@ gitem_t itemlist[] = { .pickup_name = "Blaster", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_BLASTER, - .precaches = "models/objects/laser/tris.md2 weapons/blastf1a.wav misc/lasfly.wav", + .precaches = (const char *const []) { + "models/objects/laser/tris.md2", + "weapons/blastf1a.wav", + "misc/lasfly.wav", + NULL + }, }, /*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1203,7 +1208,11 @@ gitem_t itemlist[] = { .ammo = "Shells", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_SHOTGUN, - .precaches = "weapons/shotgf1b.wav weapons/shotgr1b.wav", + .precaches = (const char *const []) { + "weapons/shotgf1b.wav", + "weapons/shotgr1b.wav", + NULL + }, }, /*QUAKED weapon_supershotgun (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1224,7 +1233,10 @@ gitem_t itemlist[] = { .ammo = "Shells", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_SUPERSHOTGUN, - .precaches = "weapons/sshotf1b.wav" + .precaches = (const char *const []) { + "weapons/sshotf1b.wav", + NULL + }, }, /*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1245,7 +1257,14 @@ gitem_t itemlist[] = { .ammo = "Bullets", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_MACHINEGUN, - .precaches = "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav", + .precaches = (const char *const []) { + "weapons/machgf1b.wav", + "weapons/machgf2b.wav", + "weapons/machgf3b.wav", + "weapons/machgf4b.wav", + "weapons/machgf5b.wav", + NULL + }, }, /*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1266,7 +1285,17 @@ gitem_t itemlist[] = { .ammo = "Bullets", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_CHAINGUN, - .precaches = "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/chngnd1a.wav", + .precaches = (const char *const []) { + "weapons/machgf1b.wav", + "weapons/machgf2b.wav", + "weapons/machgf3b.wav", + "weapons/machgf4b.wav", + "weapons/machgf5b.wav", + "weapons/chngnu1a.wav", + "weapons/chngnl1a.wav", + "weapons/chngnd1a.wav", + NULL + }, }, /*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1288,7 +1317,15 @@ gitem_t itemlist[] = { .flags = IT_AMMO | IT_WEAPON, .weapmodel = WEAP_GRENADES, .tag = AMMO_GRENADES, - .precaches = "models/objects/grenade2/tris.md2 weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav", + .precaches = (const char *const []) { + "models/objects/grenade2/tris.md2", + "weapons/hgrent1a.wav", + "weapons/hgrena1b.wav", + "weapons/hgrenc1b.wav", + "weapons/hgrenb1a.wav", + "weapons/hgrenb2a.wav", + NULL + }, }, /*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1309,7 +1346,13 @@ gitem_t itemlist[] = { .ammo = "Grenades", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_GRENADELAUNCHER, - .precaches = "models/objects/grenade/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav", + .precaches = (const char *const []) { + "models/objects/grenade/tris.md2", + "weapons/grenlf1a.wav", + "weapons/grenlr1b.wav", + "weapons/grenlb1b.wav", + NULL + }, }, /*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1330,7 +1373,14 @@ gitem_t itemlist[] = { .ammo = "Rockets", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_ROCKETLAUNCHER, - .precaches = "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2", + .precaches = (const char *const []) { + "models/objects/rocket/tris.md2", + "models/objects/debris2/tris.md2", + "weapons/rockfly.wav", + "weapons/rocklf1a.wav", + "weapons/rocklr1b.wav", + NULL + }, }, /*QUAKED weapon_hyperblaster (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1351,7 +1401,15 @@ gitem_t itemlist[] = { .ammo = "Cells", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_HYPERBLASTER, - .precaches = "models/objects/laser/tris.md2 weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav", + .precaches = (const char *const []) { + "models/objects/laser/tris.md2", + "weapons/hyprbu1a.wav", + "weapons/hyprbl1a.wav", + "weapons/hyprbf1a.wav", + "weapons/hyprbd1a.wav", + "misc/lasfly.wav", + NULL + }, }, /*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1372,7 +1430,11 @@ gitem_t itemlist[] = { .ammo = "Slugs", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_RAILGUN, - .precaches = "weapons/railgf1a.wav weapons/rg_hum.wav", + .precaches = (const char *const []) { + "weapons/railgf1a.wav", + "weapons/rg_hum.wav", + NULL + }, }, /*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1393,7 +1455,16 @@ gitem_t itemlist[] = { .ammo = "Cells", .flags = IT_WEAPON | IT_STAY_COOP, .weapmodel = WEAP_BFG, - .precaches = "sprites/s_bfg1.sp2 sprites/s_bfg2.sp2 sprites/s_bfg3.sp2 weapons/bfg__f1y.wav weapons/bfg__l1a.wav weapons/bfg__x1b.wav weapons/bfg_hum.wav", + .precaches = (const char *const []) { + "sprites/s_bfg1.sp2", + "sprites/s_bfg2.sp2", + "sprites/s_bfg3.sp2", + "weapons/bfg__f1y.wav", + "weapons/bfg__l1a.wav", + "weapons/bfg__x1b.wav", + "weapons/bfg_hum.wav", + NULL + }, }, /*QUAKED weapon_flaregun (.3 .3 1) (-16 -16 -16) (16 16 16)*/ @@ -1413,7 +1484,7 @@ gitem_t itemlist[] = { .ammo = "Grenades", // Type of ammo to use .flags = IT_WEAPON, // IT_WEAPON, IT_ARMOR, or IT_AMMO .weapmodel = WEAP_FLAREGUN, - .precaches = "" //things to precache + .precaches = (const char *const []) { NULL } //things to precache }, // // AMMO ITEMS @@ -1518,7 +1589,12 @@ gitem_t itemlist[] = { .count_width = 2, .quantity = 60, .flags = IT_POWERUP, - .precaches = "items/damage.wav items/damage2.wav items/damage3.wav", + .precaches = (const char *const []) { + "items/damage.wav", + "items/damage2.wav", + "items/damage3.wav", + NULL + }, }, /*QUAKED item_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1536,7 +1612,12 @@ gitem_t itemlist[] = { .count_width = 2, .quantity = 300, .flags = IT_POWERUP, - .precaches = "items/protect.wav items/protect2.wav items/protect4.wav", + .precaches = (const char *const []) { + "items/protect.wav", + "items/protect2.wav", + "items/protect4.wav", + NULL + }, }, /*QUAKED item_silencer (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1571,7 +1652,10 @@ gitem_t itemlist[] = { .count_width = 2, .quantity = 60, .flags = IT_STAY_COOP | IT_POWERUP, - .precaches = "items/airout.wav", + .precaches = (const char *const []) { + "items/airout.wav", + NULL + }, }, /*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1589,7 +1673,10 @@ gitem_t itemlist[] = { .count_width = 2, .quantity = 60, .flags = IT_STAY_COOP | IT_POWERUP, - .precaches = "items/airout.wav", + .precaches = (const char *const []) { + "items/airout.wav", + NULL + }, }, /*QUAKED item_ancient_head (.3 .3 1) (-16 -16 -16) (16 16 16) @@ -1803,7 +1890,13 @@ gitem_t itemlist[] = { .icon = "i_health", .pickup_name = "Health", .count_width = 3, - .precaches = "items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav", + .precaches = (const char *const []) { + "items/s_health.wav", + "items/n_health.wav", + "items/l_health.wav", + "items/m_health.wav", + NULL + }, }, // end of list marker diff --git a/src/baseq2/g_local.h b/src/baseq2/g_local.h index a108b2840..f290d3424 100644 --- a/src/baseq2/g_local.h +++ b/src/baseq2/g_local.h @@ -254,7 +254,7 @@ typedef struct gitem_s { void *info; int tag; - char *precaches; // string of all models, sounds, and images this item will use + const char *const *precaches; // array of all models, sounds, and images this item will use } gitem_t; From cf6b6d5c714eb581ce946358992ed302be1d89ba Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 17 Aug 2023 13:48:59 +0300 Subject: [PATCH 06/15] Const-ify itemlist[]. --- src/baseq2/g_cmds.c | 24 +++++++++--------- src/baseq2/g_combat.c | 2 +- src/baseq2/g_items.c | 57 ++++++++++++++++++++----------------------- src/baseq2/g_local.h | 28 ++++++++++----------- src/baseq2/g_save.c | 4 +-- src/baseq2/g_spawn.c | 2 +- src/baseq2/p_client.c | 8 +++--- src/baseq2/p_hud.c | 2 +- src/baseq2/p_weapon.c | 8 +++--- 9 files changed, 65 insertions(+), 70 deletions(-) diff --git a/src/baseq2/g_cmds.c b/src/baseq2/g_cmds.c index a931b2e55..50e5a6f1e 100644 --- a/src/baseq2/g_cmds.c +++ b/src/baseq2/g_cmds.c @@ -64,7 +64,7 @@ void SelectNextItem(edict_t *ent, int itflags) { gclient_t *cl; int i, index; - gitem_t *it; + const gitem_t *it; cl = ent->client; @@ -95,7 +95,7 @@ void SelectPrevItem(edict_t *ent, int itflags) { gclient_t *cl; int i, index; - gitem_t *it; + const gitem_t *it; cl = ent->client; @@ -147,7 +147,7 @@ Give items to a client void Cmd_Give_f(edict_t *ent) { char *name; - gitem_t *it; + const gitem_t *it; int index; int i; bool give_all; @@ -357,7 +357,7 @@ Use an inventory item void Cmd_Use_f(edict_t *ent) { int index; - gitem_t *it; + const gitem_t *it; char *s; s = gi.args(); @@ -390,7 +390,7 @@ Drop an inventory item void Cmd_Drop_f(edict_t *ent) { int index; - gitem_t *it; + const gitem_t *it; char *s; s = gi.args(); @@ -399,7 +399,7 @@ void Cmd_Drop_f(edict_t *ent) gi.cprintf(ent, PRINT_HIGH, "unknown item: %s\n", s); return; } - if (!it->drop) { + if (!it->drop || ((coop->value) && (it->flags & IT_STAY_COOP))) { gi.cprintf(ent, PRINT_HIGH, "Item is not dropable.\n"); return; } @@ -449,7 +449,7 @@ Cmd_InvUse_f */ void Cmd_InvUse_f(edict_t *ent) { - gitem_t *it; + const gitem_t *it; ValidateSelectedItem(ent); @@ -475,7 +475,7 @@ void Cmd_WeapPrev_f(edict_t *ent) { gclient_t *cl; int i, index; - gitem_t *it; + const gitem_t *it; int selected_weapon; cl = ent->client; @@ -510,7 +510,7 @@ void Cmd_WeapNext_f(edict_t *ent) { gclient_t *cl; int i, index; - gitem_t *it; + const gitem_t *it; int selected_weapon; cl = ent->client; @@ -545,7 +545,7 @@ void Cmd_WeapLast_f(edict_t *ent) { gclient_t *cl; int index; - gitem_t *it; + const gitem_t *it; cl = ent->client; @@ -570,7 +570,7 @@ Cmd_InvDrop_f */ void Cmd_InvDrop_f(edict_t *ent) { - gitem_t *it; + const gitem_t *it; ValidateSelectedItem(ent); @@ -580,7 +580,7 @@ void Cmd_InvDrop_f(edict_t *ent) } it = &itemlist[ent->client->pers.selected_item]; - if (!it->drop) { + if (!it->drop || ((coop->value) && (it->flags & IT_STAY_COOP))) { gi.cprintf(ent, PRINT_HIGH, "Item is not dropable.\n"); return; } diff --git a/src/baseq2/g_combat.c b/src/baseq2/g_combat.c index b11be9fe7..ebce6cbed 100644 --- a/src/baseq2/g_combat.c +++ b/src/baseq2/g_combat.c @@ -245,7 +245,7 @@ static int CheckArmor(edict_t *ent, const vec3_t point, const vec3_t normal, int gclient_t *client; int save; int index; - gitem_t *armor; + const gitem_t *armor; if (!damage) return 0; diff --git a/src/baseq2/g_items.c b/src/baseq2/g_items.c index 995011482..5785230ed 100644 --- a/src/baseq2/g_items.c +++ b/src/baseq2/g_items.c @@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., bool Pickup_Weapon(edict_t *ent, edict_t *other); -void Use_Weapon(edict_t *ent, gitem_t *inv); -void Drop_Weapon(edict_t *ent, gitem_t *inv); +void Use_Weapon(edict_t *ent, const gitem_t *inv); +void Drop_Weapon(edict_t *ent, const gitem_t *inv); void Weapon_Blaster(edict_t *ent); void Weapon_Shotgun(edict_t *ent); @@ -48,7 +48,7 @@ static int power_shield_index; #define HEALTH_IGNORE_MAX 1 #define HEALTH_TIMED 2 -void Use_Quad(edict_t *ent, gitem_t *item); +void Use_Quad(edict_t *ent, const gitem_t *item); static int quad_drop_timeout_hack; //====================================================================== @@ -58,7 +58,7 @@ static int quad_drop_timeout_hack; GetItemByIndex =============== */ -gitem_t *GetItemByIndex(int index) +const gitem_t *GetItemByIndex(int index) { if (index == 0 || index >= game.num_items) return NULL; @@ -73,10 +73,10 @@ FindItemByClassname =============== */ -gitem_t *FindItemByClassname(char *classname) +const gitem_t *FindItemByClassname(const char *classname) { int i; - gitem_t *it; + const gitem_t *it; it = itemlist; for (i = 0 ; i < game.num_items ; i++, it++) { @@ -95,10 +95,10 @@ FindItem =============== */ -gitem_t *FindItem(char *pickup_name) +const gitem_t *FindItem(const char *pickup_name) { int i; - gitem_t *it; + const gitem_t *it; it = itemlist; for (i = 0 ; i < game.num_items ; i++, it++) { @@ -178,7 +178,7 @@ bool Pickup_Powerup(edict_t *ent, edict_t *other) return true; } -void Drop_General(edict_t *ent, gitem_t *item) +void Drop_General(edict_t *ent, const gitem_t *item) { Drop_Item(ent, item); ent->client->pers.inventory[ITEM_INDEX(item)]--; @@ -214,7 +214,7 @@ bool Pickup_AncientHead(edict_t *ent, edict_t *other) bool Pickup_Bandolier(edict_t *ent, edict_t *other) { - gitem_t *item; + const gitem_t *item; int index; if (other->client->pers.max_bullets < 250) @@ -250,7 +250,7 @@ bool Pickup_Bandolier(edict_t *ent, edict_t *other) bool Pickup_Pack(edict_t *ent, edict_t *other) { - gitem_t *item; + const gitem_t *item; int index; if (other->client->pers.max_bullets < 300) @@ -322,7 +322,7 @@ bool Pickup_Pack(edict_t *ent, edict_t *other) //====================================================================== -void Use_Quad(edict_t *ent, gitem_t *item) +void Use_Quad(edict_t *ent, const gitem_t *item) { int timeout; @@ -346,7 +346,7 @@ void Use_Quad(edict_t *ent, gitem_t *item) //====================================================================== -void Use_Breather(edict_t *ent, gitem_t *item) +void Use_Breather(edict_t *ent, const gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; ValidateSelectedItem(ent); @@ -361,7 +361,7 @@ void Use_Breather(edict_t *ent, gitem_t *item) //====================================================================== -void Use_Envirosuit(edict_t *ent, gitem_t *item) +void Use_Envirosuit(edict_t *ent, const gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; ValidateSelectedItem(ent); @@ -376,7 +376,7 @@ void Use_Envirosuit(edict_t *ent, gitem_t *item) //====================================================================== -void Use_Invulnerability(edict_t *ent, gitem_t *item) +void Use_Invulnerability(edict_t *ent, const gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; ValidateSelectedItem(ent); @@ -391,7 +391,7 @@ void Use_Invulnerability(edict_t *ent, gitem_t *item) //====================================================================== -void Use_Silencer(edict_t *ent, gitem_t *item) +void Use_Silencer(edict_t *ent, const gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; ValidateSelectedItem(ent); @@ -423,7 +423,7 @@ bool Pickup_Key(edict_t *ent, edict_t *other) //====================================================================== -bool Add_Ammo(edict_t *ent, gitem_t *item, int count) +bool Add_Ammo(edict_t *ent, const gitem_t *item, int count) { int index; int max; @@ -488,7 +488,7 @@ bool Pickup_Ammo(edict_t *ent, edict_t *other) return true; } -void Drop_Ammo(edict_t *ent, gitem_t *item) +void Drop_Ammo(edict_t *ent, const gitem_t *item) { edict_t *dropped; int index; @@ -669,7 +669,7 @@ int PowerArmorType(edict_t *ent) return POWER_ARMOR_NONE; } -void Use_PowerArmor(edict_t *ent, gitem_t *item) +void Use_PowerArmor(edict_t *ent, const gitem_t *item) { int index; @@ -706,7 +706,7 @@ bool Pickup_PowerArmor(edict_t *ent, edict_t *other) return true; } -void Drop_PowerArmor(edict_t *ent, gitem_t *item) +void Drop_PowerArmor(edict_t *ent, const gitem_t *item) { if ((ent->flags & FL_POWER_ARMOR) && (ent->client->pers.inventory[ITEM_INDEX(item)] == 1)) Use_PowerArmor(ent, item); @@ -795,7 +795,7 @@ void drop_make_touchable(edict_t *ent) } } -edict_t *Drop_Item(edict_t *ent, gitem_t *item) +edict_t *Drop_Item(edict_t *ent, const gitem_t *item) { edict_t *dropped; vec3_t forward, right; @@ -931,7 +931,7 @@ This will be called for each item spawned in a level, and for each item in each client's inventory. =============== */ -void PrecacheItem(gitem_t *it) +void PrecacheItem(const gitem_t *it) { const char *const *s; const char *data; @@ -951,7 +951,7 @@ void PrecacheItem(gitem_t *it) // parse everything for its ammo if (it->ammo && it->ammo[0]) { - gitem_t *ammo = FindItem(it->ammo); + const gitem_t *ammo = FindItem(it->ammo); if (ammo != it) PrecacheItem(ammo); } @@ -989,7 +989,7 @@ Items can't be immediately dropped to floor, because they might be on an entity that hasn't spawned yet. ============ */ -void SpawnItem(edict_t *ent, gitem_t *item) +void SpawnItem(edict_t *ent, const gitem_t *item) { PrecacheItem(item); @@ -1033,11 +1033,6 @@ void SpawnItem(edict_t *ent, gitem_t *item) level.power_cubes++; } - // don't let them drop items that stay in a coop game - if ((coop->value) && (item->flags & IT_STAY_COOP)) { - item->drop = NULL; - } - ent->item = item; ent->nextthink = level.framenum + 2; // items start after other solids ent->think = droptofloor; @@ -1049,7 +1044,7 @@ void SpawnItem(edict_t *ent, gitem_t *item) //====================================================================== -gitem_t itemlist[] = { +const gitem_t itemlist[] = { { NULL }, // leave index 0 alone @@ -1984,7 +1979,7 @@ Called by worldspawn void SetItemNames(void) { int i; - gitem_t *it; + const gitem_t *it; for (i = 0 ; i < game.num_items ; i++) { it = &itemlist[i]; diff --git a/src/baseq2/g_local.h b/src/baseq2/g_local.h index f290d3424..5c36b7341 100644 --- a/src/baseq2/g_local.h +++ b/src/baseq2/g_local.h @@ -232,8 +232,8 @@ typedef struct { typedef struct gitem_s { char *classname; // spawning name bool (*pickup)(struct edict_s *ent, struct edict_s *other); - void (*use)(struct edict_s *ent, struct gitem_s *item); - void (*drop)(struct edict_s *ent, struct gitem_s *item); + void (*use)(struct edict_s *ent, const struct gitem_s *item); + void (*drop)(struct edict_s *ent, const struct gitem_s *item); void (*weaponthink)(struct edict_s *ent); char *pickup_sound; char *world_model; @@ -587,7 +587,7 @@ typedef enum { F_FRAMETIME // speciality for savegame compatibility: float on disk, converted to framenum } fieldtype_t; -extern gitem_t itemlist[]; +extern const gitem_t itemlist[]; // // g_cmds.c @@ -598,21 +598,21 @@ void Cmd_Score_f(edict_t *ent); // // g_items.c // -void PrecacheItem(gitem_t *it); +void PrecacheItem(const gitem_t *it); void InitItems(void); void SetItemNames(void); -gitem_t *FindItem(char *pickup_name); -gitem_t *FindItemByClassname(char *classname); +const gitem_t *FindItem(const char *pickup_name); +const gitem_t *FindItemByClassname(const char *classname); #define ITEM_INDEX(x) ((x)-itemlist) -edict_t *Drop_Item(edict_t *ent, gitem_t *item); +edict_t *Drop_Item(edict_t *ent, const gitem_t *item); void SetRespawn(edict_t *ent, float delay); void ChangeWeapon(edict_t *ent); -void SpawnItem(edict_t *ent, gitem_t *item); +void SpawnItem(edict_t *ent, const gitem_t *item); void Think_Weapon(edict_t *ent); int ArmorIndex(edict_t *ent); int PowerArmorType(edict_t *ent); -gitem_t *GetItemByIndex(int index); -bool Add_Ammo(edict_t *ent, gitem_t *item, int count); +const gitem_t *GetItemByIndex(int index); +bool Add_Ammo(edict_t *ent, const gitem_t *item, int count); void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf); // @@ -845,8 +845,8 @@ typedef struct { int max_cells; int max_slugs; - gitem_t *weapon; - gitem_t *lastweapon; + const gitem_t *weapon; + const gitem_t *lastweapon; int power_cubes; // used for tracking the cubes in coop games int score; // for calculating total unit score in coop games @@ -892,7 +892,7 @@ struct gclient_s { bool weapon_thunk; - gitem_t *newweapon; + const gitem_t *newweapon; // sum up damage over an entire frame, so // shotgun blasts give a single big kick @@ -1096,7 +1096,7 @@ struct edict_s { int style; // also used as areaportal number - gitem_t *item; // for bonus items + const gitem_t *item; // for bonus items // common data blocks moveinfo_t moveinfo; diff --git a/src/baseq2/g_save.c b/src/baseq2/g_save.c index d901f160e..57f1d4126 100644 --- a/src/baseq2/g_save.c +++ b/src/baseq2/g_save.c @@ -494,7 +494,7 @@ static void write_vector(gzFile f, vec_t *v) write_float(f, v[2]); } -static void write_index(gzFile f, void *p, size_t size, void *start, int max_index) +static void write_index(gzFile f, void *p, size_t size, const void *start, int max_index) { uintptr_t diff; @@ -699,7 +699,7 @@ static void read_vector(gzFile f, vec_t *v) v[2] = read_float(f); } -static void *read_index(gzFile f, size_t size, void *start, int max_index) +static void *read_index(gzFile f, size_t size, const void *start, int max_index) { int index; byte *p; diff --git a/src/baseq2/g_spawn.c b/src/baseq2/g_spawn.c index 975add138..f0d648589 100644 --- a/src/baseq2/g_spawn.c +++ b/src/baseq2/g_spawn.c @@ -344,7 +344,7 @@ Finds the spawn function for the entity and calls it void ED_CallSpawn(edict_t *ent) { const spawn_func_t *s; - gitem_t *item; + const gitem_t *item; int i; if (!ent->classname) { diff --git a/src/baseq2/p_client.c b/src/baseq2/p_client.c index 1de7a89f9..bd9421d9a 100644 --- a/src/baseq2/p_client.c +++ b/src/baseq2/p_client.c @@ -391,7 +391,7 @@ void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) void TossClientWeapon(edict_t *self) { - gitem_t *item; + const gitem_t *item; edict_t *drop; bool quad; float spread; @@ -574,7 +574,7 @@ but is called after each death and level change in deathmatch */ void InitClientPersistant(gclient_t *client) { - gitem_t *item; + const gitem_t *item; memset(&client->pers, 0, sizeof(client->pers)); @@ -588,14 +588,14 @@ void InitClientPersistant(gclient_t *client) { // Q2RTX: Spawn with a flare gun and some grenades to use with it. // Flare gun is new and not found anywhere in the game as a pickup item. - gitem_t* item_flareg = FindItem("Flare Gun"); + const gitem_t* item_flareg = FindItem("Flare Gun"); if (item_flareg) { client->pers.inventory[ITEM_INDEX(item_flareg)] = 1; if (sv_flaregun->value == 2) { - gitem_t* item_grenades = FindItem("Grenades"); + const gitem_t* item_grenades = FindItem("Grenades"); client->pers.inventory[ITEM_INDEX(item_grenades)] = 5; } } diff --git a/src/baseq2/p_hud.c b/src/baseq2/p_hud.c index 271b2dc5f..d03b228dd 100644 --- a/src/baseq2/p_hud.c +++ b/src/baseq2/p_hud.c @@ -364,7 +364,7 @@ G_SetStats */ void G_SetStats(edict_t *ent) { - gitem_t *item; + const gitem_t *item; int index, cells; int power_armor_type; diff --git a/src/baseq2/p_weapon.c b/src/baseq2/p_weapon.c index c031dff9f..5395626da 100644 --- a/src/baseq2/p_weapon.c +++ b/src/baseq2/p_weapon.c @@ -126,7 +126,7 @@ void PlayerNoise(edict_t *who, vec3_t where, int type) bool Pickup_Weapon(edict_t *ent, edict_t *other) { int index; - gitem_t *ammo; + const gitem_t *ammo; index = ITEM_INDEX(ent->item); @@ -300,10 +300,10 @@ Use_Weapon Make the weapon ready if there is ammo ================ */ -void Use_Weapon(edict_t *ent, gitem_t *item) +void Use_Weapon(edict_t *ent, const gitem_t *item) { int ammo_index; - gitem_t *ammo_item; + const gitem_t *ammo_item; // see if we're already using it if (item == ent->client->pers.weapon) @@ -335,7 +335,7 @@ void Use_Weapon(edict_t *ent, gitem_t *item) Drop_Weapon ================ */ -void Drop_Weapon(edict_t *ent, gitem_t *item) +void Drop_Weapon(edict_t *ent, const gitem_t *item) { int index; From 1251c123335a12771bfd4b13c5f73788da8cadb1 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 17 Aug 2023 13:55:26 +0300 Subject: [PATCH 07/15] Const-ify armor_info. --- src/baseq2/g_cmds.c | 4 ++-- src/baseq2/g_combat.c | 4 ++-- src/baseq2/g_items.c | 12 ++++++------ src/baseq2/g_local.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/baseq2/g_cmds.c b/src/baseq2/g_cmds.c index 50e5a6f1e..6f111eeee 100644 --- a/src/baseq2/g_cmds.c +++ b/src/baseq2/g_cmds.c @@ -201,7 +201,7 @@ void Cmd_Give_f(edict_t *ent) } if (give_all || Q_stricmp(name, "armor") == 0) { - gitem_armor_t *info; + const gitem_armor_t *info; it = FindItem("Jacket Armor"); ent->client->pers.inventory[ITEM_INDEX(it)] = 0; @@ -210,7 +210,7 @@ void Cmd_Give_f(edict_t *ent) ent->client->pers.inventory[ITEM_INDEX(it)] = 0; it = FindItem("Body Armor"); - info = (gitem_armor_t *)it->info; + info = (const gitem_armor_t *)it->info; ent->client->pers.inventory[ITEM_INDEX(it)] = info->max_count; if (!give_all) diff --git a/src/baseq2/g_combat.c b/src/baseq2/g_combat.c index ebce6cbed..d4a19a4a7 100644 --- a/src/baseq2/g_combat.c +++ b/src/baseq2/g_combat.c @@ -265,9 +265,9 @@ static int CheckArmor(edict_t *ent, const vec3_t point, const vec3_t normal, int armor = GetItemByIndex(index); if (dflags & DAMAGE_ENERGY) - save = ceil(((gitem_armor_t *)armor->info)->energy_protection * damage); + save = ceil(((const gitem_armor_t *)armor->info)->energy_protection * damage); else - save = ceil(((gitem_armor_t *)armor->info)->normal_protection * damage); + save = ceil(((const gitem_armor_t *)armor->info)->normal_protection * damage); if (save >= client->pers.inventory[index]) save = client->pers.inventory[index]; diff --git a/src/baseq2/g_items.c b/src/baseq2/g_items.c index 5785230ed..54e1dfceb 100644 --- a/src/baseq2/g_items.c +++ b/src/baseq2/g_items.c @@ -35,9 +35,9 @@ void Weapon_Railgun(edict_t *ent); void Weapon_BFG(edict_t *ent); void Weapon_FlareGun(edict_t *ent); -gitem_armor_t jacketarmor_info = { 25, 50, .30f, .00f, ARMOR_JACKET}; -gitem_armor_t combatarmor_info = { 50, 100, .60f, .30f, ARMOR_COMBAT}; -gitem_armor_t bodyarmor_info = {100, 200, .80f, .60f, ARMOR_BODY}; +static const gitem_armor_t jacketarmor_info = { 25, 50, .30f, .00f, ARMOR_JACKET}; +static const gitem_armor_t combatarmor_info = { 50, 100, .60f, .30f, ARMOR_COMBAT}; +static const gitem_armor_t bodyarmor_info = {100, 200, .80f, .60f, ARMOR_BODY}; static int jacket_armor_index; static int combat_armor_index; @@ -580,14 +580,14 @@ int ArmorIndex(edict_t *ent) bool Pickup_Armor(edict_t *ent, edict_t *other) { int old_armor_index; - gitem_armor_t *oldinfo; - gitem_armor_t *newinfo; + const gitem_armor_t *oldinfo; + const gitem_armor_t *newinfo; int newcount; float salvage; int salvagecount; // get info on new armor - newinfo = (gitem_armor_t *)ent->item->info; + newinfo = (const gitem_armor_t *)ent->item->info; old_armor_index = ArmorIndex(other); diff --git a/src/baseq2/g_local.h b/src/baseq2/g_local.h index 5c36b7341..da48bd293 100644 --- a/src/baseq2/g_local.h +++ b/src/baseq2/g_local.h @@ -251,7 +251,7 @@ typedef struct gitem_s { int weapmodel; // weapon model index (for weapons) - void *info; + const void *info; int tag; const char *const *precaches; // array of all models, sounds, and images this item will use From 0bd74ccdd423a6b911560fd7c897de13635b73d2 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 17 Aug 2023 14:01:23 +0300 Subject: [PATCH 08/15] Const-ify weapon_frames[]. --- src/baseq2/p_weapon.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/baseq2/p_weapon.c b/src/baseq2/p_weapon.c index 5395626da..995a4e1cd 100644 --- a/src/baseq2/p_weapon.c +++ b/src/baseq2/p_weapon.c @@ -365,7 +365,7 @@ A generic function to handle the basics of weapon thinking #define FRAME_IDLE_FIRST (FRAME_FIRE_LAST + 1) #define FRAME_DEACTIVATE_FIRST (FRAME_IDLE_LAST + 1) -void Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int FRAME_IDLE_LAST, int FRAME_DEACTIVATE_LAST, int *pause_frames, int *fire_frames, void (*fire)(edict_t *ent)) +static void Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int FRAME_IDLE_LAST, int FRAME_DEACTIVATE_LAST, const int *pause_frames, const int *fire_frames, void (*fire)(edict_t *ent)) { int n; @@ -674,8 +674,8 @@ void weapon_grenadelauncher_fire(edict_t *ent) void Weapon_GrenadeLauncher(edict_t *ent) { - static int pause_frames[] = {34, 51, 59, 0}; - static int fire_frames[] = {6, 0}; + static const int pause_frames[] = {34, 51, 59, 0}; + static const int fire_frames[] = {6, 0}; Weapon_Generic(ent, 5, 16, 59, 64, pause_frames, fire_frames, weapon_grenadelauncher_fire); } @@ -729,8 +729,8 @@ void Weapon_RocketLauncher_Fire(edict_t *ent) void Weapon_RocketLauncher(edict_t *ent) { - static int pause_frames[] = {25, 33, 42, 50, 0}; - static int fire_frames[] = {5, 0}; + static const int pause_frames[] = {25, 33, 42, 50, 0}; + static const int fire_frames[] = {5, 0}; Weapon_Generic(ent, 4, 12, 50, 54, pause_frames, fire_frames, Weapon_RocketLauncher_Fire); } @@ -789,8 +789,8 @@ void Weapon_Blaster_Fire(edict_t *ent) void Weapon_Blaster(edict_t *ent) { - static int pause_frames[] = {19, 32, 0}; - static int fire_frames[] = {5, 0}; + static const int pause_frames[] = {19, 32, 0}; + static const int fire_frames[] = {5, 0}; Weapon_Generic(ent, 4, 8, 52, 55, pause_frames, fire_frames, Weapon_Blaster_Fire); } @@ -856,8 +856,8 @@ void Weapon_HyperBlaster_Fire(edict_t *ent) void Weapon_HyperBlaster(edict_t *ent) { - static int pause_frames[] = {0}; - static int fire_frames[] = {6, 7, 8, 9, 10, 11, 0}; + static const int pause_frames[] = {0}; + static const int fire_frames[] = {6, 7, 8, 9, 10, 11, 0}; Weapon_Generic(ent, 5, 20, 49, 53, pause_frames, fire_frames, Weapon_HyperBlaster_Fire); } @@ -949,8 +949,8 @@ void Machinegun_Fire(edict_t *ent) void Weapon_Machinegun(edict_t *ent) { - static int pause_frames[] = {23, 45, 0}; - static int fire_frames[] = {4, 5, 0}; + static const int pause_frames[] = {23, 45, 0}; + static const int fire_frames[] = {4, 5, 0}; Weapon_Generic(ent, 3, 5, 45, 49, pause_frames, fire_frames, Machinegun_Fire); } @@ -1059,8 +1059,8 @@ void Chaingun_Fire(edict_t *ent) void Weapon_Chaingun(edict_t *ent) { - static int pause_frames[] = {38, 43, 51, 61, 0}; - static int fire_frames[] = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0}; + static const int pause_frames[] = {38, 43, 51, 61, 0}; + static const int fire_frames[] = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0}; Weapon_Generic(ent, 4, 31, 61, 64, pause_frames, fire_frames, Chaingun_Fire); } @@ -1120,8 +1120,8 @@ void weapon_shotgun_fire(edict_t *ent) void Weapon_Shotgun(edict_t *ent) { - static int pause_frames[] = {22, 28, 34, 0}; - static int fire_frames[] = {8, 9, 0}; + static const int pause_frames[] = {22, 28, 34, 0}; + static const int fire_frames[] = {8, 9, 0}; Weapon_Generic(ent, 7, 18, 36, 39, pause_frames, fire_frames, weapon_shotgun_fire); } @@ -1197,8 +1197,8 @@ void weapon_supershotgun_fire(edict_t *ent) void Weapon_SuperShotgun(edict_t *ent) { - static int pause_frames[] = {29, 42, 57, 0}; - static int fire_frames[] = {7, 0}; + static const int pause_frames[] = {29, 42, 57, 0}; + static const int fire_frames[] = {7, 0}; Weapon_Generic(ent, 6, 17, 57, 61, pause_frames, fire_frames, weapon_supershotgun_fire); } @@ -1260,8 +1260,8 @@ void weapon_railgun_fire(edict_t *ent) void Weapon_Railgun(edict_t *ent) { - static int pause_frames[] = {56, 0}; - static int fire_frames[] = {4, 0}; + static const int pause_frames[] = {56, 0}; + static const int fire_frames[] = {4, 0}; Weapon_Generic(ent, 3, 18, 56, 61, pause_frames, fire_frames, weapon_railgun_fire); } @@ -1333,8 +1333,8 @@ void weapon_bfg_fire(edict_t *ent) void Weapon_BFG(edict_t *ent) { - static int pause_frames[] = {39, 45, 50, 55, 0}; - static int fire_frames[] = {9, 17, 0}; + static const int pause_frames[] = {39, 45, 50, 55, 0}; + static const int fire_frames[] = {9, 17, 0}; Weapon_Generic(ent, 8, 32, 55, 58, pause_frames, fire_frames, weapon_bfg_fire); } From 3a44cb4534c3a9264630e8fd4a5089b13d543c41 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 17 Aug 2023 14:11:00 +0300 Subject: [PATCH 09/15] Const-ify monster moveinfo. --- src/baseq2/g_local.h | 4 +- src/baseq2/g_monster.c | 2 +- src/baseq2/g_ptrs.c | 510 +++++++++++++++++++-------------------- src/baseq2/g_ptrs.h | 2 +- src/baseq2/g_save.c | 2 +- src/baseq2/genptr.py | 2 +- src/baseq2/m_actor.c | 44 ++-- src/baseq2/m_berserk.c | 44 ++-- src/baseq2/m_boss2.c | 44 ++-- src/baseq2/m_boss31.c | 52 ++-- src/baseq2/m_boss32.c | 58 ++--- src/baseq2/m_brain.c | 52 ++-- src/baseq2/m_chick.c | 68 +++--- src/baseq2/m_flipper.c | 36 +-- src/baseq2/m_float.c | 48 ++-- src/baseq2/m_flyer.c | 68 +++--- src/baseq2/m_gladiator.c | 32 +-- src/baseq2/m_gunner.c | 56 ++--- src/baseq2/m_hover.c | 64 ++--- src/baseq2/m_infantry.c | 48 ++-- src/baseq2/m_insane.c | 66 ++--- src/baseq2/m_medic.c | 40 +-- src/baseq2/m_mutant.c | 48 ++-- src/baseq2/m_parasite.c | 52 ++-- src/baseq2/m_soldier.c | 88 +++---- src/baseq2/m_supertank.c | 60 ++--- src/baseq2/m_tank.c | 76 +++--- 27 files changed, 827 insertions(+), 839 deletions(-) diff --git a/src/baseq2/g_local.h b/src/baseq2/g_local.h index da48bd293..c227b8298 100644 --- a/src/baseq2/g_local.h +++ b/src/baseq2/g_local.h @@ -402,12 +402,12 @@ typedef struct { typedef struct { int firstframe; int lastframe; - mframe_t *frame; + const mframe_t *frame; void (*endfunc)(edict_t *self); } mmove_t; typedef struct { - mmove_t *currentmove; + const mmove_t *currentmove; int aiflags; int nextframe; float scale; diff --git a/src/baseq2/g_monster.c b/src/baseq2/g_monster.c index da8ce9374..ff5724e2c 100644 --- a/src/baseq2/g_monster.c +++ b/src/baseq2/g_monster.c @@ -331,7 +331,7 @@ void M_SetEffects(edict_t *ent) void M_MoveFrame(edict_t *self) { - mmove_t *move; + const mmove_t *move; int index; move = self->monsterinfo.currentmove; diff --git a/src/baseq2/g_ptrs.c b/src/baseq2/g_ptrs.c index efd0a053a..b34262008 100644 --- a/src/baseq2/g_ptrs.c +++ b/src/baseq2/g_ptrs.c @@ -7,261 +7,261 @@ extern bool M_CheckAttack(edict_t *); extern bool Makron_CheckAttack(edict_t *); extern bool medic_checkattack(edict_t *); extern bool mutant_checkattack(edict_t *); -extern mmove_t actor_move_attack; -extern mmove_t actor_move_death1; -extern mmove_t actor_move_death2; -extern mmove_t actor_move_flipoff; -extern mmove_t actor_move_pain1; -extern mmove_t actor_move_pain2; -extern mmove_t actor_move_pain3; -extern mmove_t actor_move_run; -extern mmove_t actor_move_stand; -extern mmove_t actor_move_taunt; -extern mmove_t actor_move_walk; -extern mmove_t berserk_move_attack_club; -extern mmove_t berserk_move_attack_spike; -extern mmove_t berserk_move_death1; -extern mmove_t berserk_move_death2; -extern mmove_t berserk_move_pain1; -extern mmove_t berserk_move_pain2; -extern mmove_t berserk_move_run1; -extern mmove_t berserk_move_stand; -extern mmove_t berserk_move_stand_fidget; -extern mmove_t berserk_move_walk; -extern mmove_t boss2_move_attack_mg; -extern mmove_t boss2_move_attack_post_mg; -extern mmove_t boss2_move_attack_pre_mg; -extern mmove_t boss2_move_attack_rocket; -extern mmove_t boss2_move_death; -extern mmove_t boss2_move_pain_heavy; -extern mmove_t boss2_move_pain_light; -extern mmove_t boss2_move_run; -extern mmove_t boss2_move_stand; -extern mmove_t boss2_move_walk; -extern mmove_t brain_move_attack1; -extern mmove_t brain_move_attack2; -extern mmove_t brain_move_death1; -extern mmove_t brain_move_death2; -extern mmove_t brain_move_duck; -extern mmove_t brain_move_idle; -extern mmove_t brain_move_pain1; -extern mmove_t brain_move_pain2; -extern mmove_t brain_move_pain3; -extern mmove_t brain_move_run; -extern mmove_t brain_move_stand; -extern mmove_t brain_move_walk1; -extern mmove_t chick_move_attack1; -extern mmove_t chick_move_death1; -extern mmove_t chick_move_death2; -extern mmove_t chick_move_duck; -extern mmove_t chick_move_end_attack1; -extern mmove_t chick_move_end_slash; -extern mmove_t chick_move_fidget; -extern mmove_t chick_move_pain1; -extern mmove_t chick_move_pain2; -extern mmove_t chick_move_pain3; -extern mmove_t chick_move_run; -extern mmove_t chick_move_slash; -extern mmove_t chick_move_stand; -extern mmove_t chick_move_start_attack1; -extern mmove_t chick_move_start_run; -extern mmove_t chick_move_start_slash; -extern mmove_t chick_move_walk; -extern mmove_t flipper_move_attack; -extern mmove_t flipper_move_death; -extern mmove_t flipper_move_pain1; -extern mmove_t flipper_move_pain2; -extern mmove_t flipper_move_run_loop; -extern mmove_t flipper_move_run_start; -extern mmove_t flipper_move_stand; -extern mmove_t flipper_move_start_run; -extern mmove_t flipper_move_walk; -extern mmove_t floater_move_attack1; -extern mmove_t floater_move_attack2; -extern mmove_t floater_move_attack3; -extern mmove_t floater_move_pain1; -extern mmove_t floater_move_pain2; -extern mmove_t floater_move_run; -extern mmove_t floater_move_stand1; -extern mmove_t floater_move_stand2; -extern mmove_t floater_move_walk; -extern mmove_t flyer_move_attack2; -extern mmove_t flyer_move_end_melee; -extern mmove_t flyer_move_loop_melee; -extern mmove_t flyer_move_pain1; -extern mmove_t flyer_move_pain2; -extern mmove_t flyer_move_pain3; -extern mmove_t flyer_move_run; -extern mmove_t flyer_move_stand; -extern mmove_t flyer_move_start; -extern mmove_t flyer_move_start_melee; -extern mmove_t flyer_move_stop; -extern mmove_t flyer_move_walk; -extern mmove_t gladiator_move_attack_gun; -extern mmove_t gladiator_move_attack_melee; -extern mmove_t gladiator_move_death; -extern mmove_t gladiator_move_pain; -extern mmove_t gladiator_move_pain_air; -extern mmove_t gladiator_move_run; -extern mmove_t gladiator_move_stand; -extern mmove_t gladiator_move_walk; -extern mmove_t gunner_move_attack_chain; -extern mmove_t gunner_move_attack_grenade; -extern mmove_t gunner_move_death; -extern mmove_t gunner_move_duck; -extern mmove_t gunner_move_endfire_chain; -extern mmove_t gunner_move_fidget; -extern mmove_t gunner_move_fire_chain; -extern mmove_t gunner_move_pain1; -extern mmove_t gunner_move_pain2; -extern mmove_t gunner_move_pain3; -extern mmove_t gunner_move_run; -extern mmove_t gunner_move_runandshoot; -extern mmove_t gunner_move_stand; -extern mmove_t gunner_move_walk; -extern mmove_t hover_move_attack1; -extern mmove_t hover_move_death1; -extern mmove_t hover_move_end_attack; -extern mmove_t hover_move_pain1; -extern mmove_t hover_move_pain2; -extern mmove_t hover_move_pain3; -extern mmove_t hover_move_run; -extern mmove_t hover_move_stand; -extern mmove_t hover_move_start_attack; -extern mmove_t hover_move_walk; -extern mmove_t infantry_move_attack1; -extern mmove_t infantry_move_attack2; -extern mmove_t infantry_move_death1; -extern mmove_t infantry_move_death2; -extern mmove_t infantry_move_death3; -extern mmove_t infantry_move_duck; -extern mmove_t infantry_move_fidget; -extern mmove_t infantry_move_pain1; -extern mmove_t infantry_move_pain2; -extern mmove_t infantry_move_run; -extern mmove_t infantry_move_stand; -extern mmove_t infantry_move_walk; -extern mmove_t insane_move_crawl; -extern mmove_t insane_move_crawl_death; -extern mmove_t insane_move_crawl_pain; -extern mmove_t insane_move_cross; -extern mmove_t insane_move_down; -extern mmove_t insane_move_downtoup; -extern mmove_t insane_move_jumpdown; -extern mmove_t insane_move_run_insane; -extern mmove_t insane_move_run_normal; -extern mmove_t insane_move_runcrawl; -extern mmove_t insane_move_stand_death; -extern mmove_t insane_move_stand_insane; -extern mmove_t insane_move_stand_normal; -extern mmove_t insane_move_stand_pain; -extern mmove_t insane_move_struggle_cross; -extern mmove_t insane_move_uptodown; -extern mmove_t insane_move_walk_insane; -extern mmove_t insane_move_walk_normal; -extern mmove_t jorg_move_attack1; -extern mmove_t jorg_move_attack2; -extern mmove_t jorg_move_death; -extern mmove_t jorg_move_end_attack1; -extern mmove_t jorg_move_pain1; -extern mmove_t jorg_move_pain2; -extern mmove_t jorg_move_pain3; -extern mmove_t jorg_move_run; -extern mmove_t jorg_move_stand; -extern mmove_t jorg_move_start_attack1; -extern mmove_t jorg_move_walk; -extern mmove_t makron_move_attack3; -extern mmove_t makron_move_attack4; -extern mmove_t makron_move_attack5; -extern mmove_t makron_move_death2; -extern mmove_t makron_move_pain4; -extern mmove_t makron_move_pain5; -extern mmove_t makron_move_pain6; -extern mmove_t makron_move_run; -extern mmove_t makron_move_sight; -extern mmove_t makron_move_stand; -extern mmove_t makron_move_walk; -extern mmove_t medic_move_attackBlaster; -extern mmove_t medic_move_attackCable; -extern mmove_t medic_move_attackHyperBlaster; -extern mmove_t medic_move_death; -extern mmove_t medic_move_duck; -extern mmove_t medic_move_pain1; -extern mmove_t medic_move_pain2; -extern mmove_t medic_move_run; -extern mmove_t medic_move_stand; -extern mmove_t medic_move_walk; -extern mmove_t mutant_move_attack; -extern mmove_t mutant_move_death1; -extern mmove_t mutant_move_death2; -extern mmove_t mutant_move_idle; -extern mmove_t mutant_move_jump; -extern mmove_t mutant_move_pain1; -extern mmove_t mutant_move_pain2; -extern mmove_t mutant_move_pain3; -extern mmove_t mutant_move_run; -extern mmove_t mutant_move_stand; -extern mmove_t mutant_move_start_walk; -extern mmove_t mutant_move_walk; -extern mmove_t parasite_move_death; -extern mmove_t parasite_move_drain; -extern mmove_t parasite_move_end_fidget; -extern mmove_t parasite_move_fidget; -extern mmove_t parasite_move_pain1; -extern mmove_t parasite_move_run; -extern mmove_t parasite_move_stand; -extern mmove_t parasite_move_start_fidget; -extern mmove_t parasite_move_start_run; -extern mmove_t parasite_move_start_walk; -extern mmove_t parasite_move_walk; -extern mmove_t soldier_move_attack1; -extern mmove_t soldier_move_attack2; -extern mmove_t soldier_move_attack3; -extern mmove_t soldier_move_attack4; -extern mmove_t soldier_move_attack6; -extern mmove_t soldier_move_death1; -extern mmove_t soldier_move_death2; -extern mmove_t soldier_move_death3; -extern mmove_t soldier_move_death4; -extern mmove_t soldier_move_death5; -extern mmove_t soldier_move_death6; -extern mmove_t soldier_move_duck; -extern mmove_t soldier_move_pain1; -extern mmove_t soldier_move_pain2; -extern mmove_t soldier_move_pain3; -extern mmove_t soldier_move_pain4; -extern mmove_t soldier_move_run; -extern mmove_t soldier_move_stand1; -extern mmove_t soldier_move_stand3; -extern mmove_t soldier_move_start_run; -extern mmove_t soldier_move_walk1; -extern mmove_t soldier_move_walk2; -extern mmove_t supertank_move_attack1; -extern mmove_t supertank_move_attack2; -extern mmove_t supertank_move_death; -extern mmove_t supertank_move_end_attack1; -extern mmove_t supertank_move_forward; -extern mmove_t supertank_move_pain1; -extern mmove_t supertank_move_pain2; -extern mmove_t supertank_move_pain3; -extern mmove_t supertank_move_run; -extern mmove_t supertank_move_stand; -extern mmove_t tank_move_attack_blast; -extern mmove_t tank_move_attack_chain; -extern mmove_t tank_move_attack_fire_rocket; -extern mmove_t tank_move_attack_post_blast; -extern mmove_t tank_move_attack_post_rocket; -extern mmove_t tank_move_attack_pre_rocket; -extern mmove_t tank_move_attack_strike; -extern mmove_t tank_move_death; -extern mmove_t tank_move_pain1; -extern mmove_t tank_move_pain2; -extern mmove_t tank_move_pain3; -extern mmove_t tank_move_reattack_blast; -extern mmove_t tank_move_run; -extern mmove_t tank_move_stand; -extern mmove_t tank_move_start_run; -extern mmove_t tank_move_walk; +extern const mmove_t actor_move_attack; +extern const mmove_t actor_move_death1; +extern const mmove_t actor_move_death2; +extern const mmove_t actor_move_flipoff; +extern const mmove_t actor_move_pain1; +extern const mmove_t actor_move_pain2; +extern const mmove_t actor_move_pain3; +extern const mmove_t actor_move_run; +extern const mmove_t actor_move_stand; +extern const mmove_t actor_move_taunt; +extern const mmove_t actor_move_walk; +extern const mmove_t berserk_move_attack_club; +extern const mmove_t berserk_move_attack_spike; +extern const mmove_t berserk_move_death1; +extern const mmove_t berserk_move_death2; +extern const mmove_t berserk_move_pain1; +extern const mmove_t berserk_move_pain2; +extern const mmove_t berserk_move_run1; +extern const mmove_t berserk_move_stand; +extern const mmove_t berserk_move_stand_fidget; +extern const mmove_t berserk_move_walk; +extern const mmove_t boss2_move_attack_mg; +extern const mmove_t boss2_move_attack_post_mg; +extern const mmove_t boss2_move_attack_pre_mg; +extern const mmove_t boss2_move_attack_rocket; +extern const mmove_t boss2_move_death; +extern const mmove_t boss2_move_pain_heavy; +extern const mmove_t boss2_move_pain_light; +extern const mmove_t boss2_move_run; +extern const mmove_t boss2_move_stand; +extern const mmove_t boss2_move_walk; +extern const mmove_t brain_move_attack1; +extern const mmove_t brain_move_attack2; +extern const mmove_t brain_move_death1; +extern const mmove_t brain_move_death2; +extern const mmove_t brain_move_duck; +extern const mmove_t brain_move_idle; +extern const mmove_t brain_move_pain1; +extern const mmove_t brain_move_pain2; +extern const mmove_t brain_move_pain3; +extern const mmove_t brain_move_run; +extern const mmove_t brain_move_stand; +extern const mmove_t brain_move_walk1; +extern const mmove_t chick_move_attack1; +extern const mmove_t chick_move_death1; +extern const mmove_t chick_move_death2; +extern const mmove_t chick_move_duck; +extern const mmove_t chick_move_end_attack1; +extern const mmove_t chick_move_end_slash; +extern const mmove_t chick_move_fidget; +extern const mmove_t chick_move_pain1; +extern const mmove_t chick_move_pain2; +extern const mmove_t chick_move_pain3; +extern const mmove_t chick_move_run; +extern const mmove_t chick_move_slash; +extern const mmove_t chick_move_stand; +extern const mmove_t chick_move_start_attack1; +extern const mmove_t chick_move_start_run; +extern const mmove_t chick_move_start_slash; +extern const mmove_t chick_move_walk; +extern const mmove_t flipper_move_attack; +extern const mmove_t flipper_move_death; +extern const mmove_t flipper_move_pain1; +extern const mmove_t flipper_move_pain2; +extern const mmove_t flipper_move_run_loop; +extern const mmove_t flipper_move_run_start; +extern const mmove_t flipper_move_stand; +extern const mmove_t flipper_move_start_run; +extern const mmove_t flipper_move_walk; +extern const mmove_t floater_move_attack1; +extern const mmove_t floater_move_attack2; +extern const mmove_t floater_move_attack3; +extern const mmove_t floater_move_pain1; +extern const mmove_t floater_move_pain2; +extern const mmove_t floater_move_run; +extern const mmove_t floater_move_stand1; +extern const mmove_t floater_move_stand2; +extern const mmove_t floater_move_walk; +extern const mmove_t flyer_move_attack2; +extern const mmove_t flyer_move_end_melee; +extern const mmove_t flyer_move_loop_melee; +extern const mmove_t flyer_move_pain1; +extern const mmove_t flyer_move_pain2; +extern const mmove_t flyer_move_pain3; +extern const mmove_t flyer_move_run; +extern const mmove_t flyer_move_stand; +extern const mmove_t flyer_move_start; +extern const mmove_t flyer_move_start_melee; +extern const mmove_t flyer_move_stop; +extern const mmove_t flyer_move_walk; +extern const mmove_t gladiator_move_attack_gun; +extern const mmove_t gladiator_move_attack_melee; +extern const mmove_t gladiator_move_death; +extern const mmove_t gladiator_move_pain; +extern const mmove_t gladiator_move_pain_air; +extern const mmove_t gladiator_move_run; +extern const mmove_t gladiator_move_stand; +extern const mmove_t gladiator_move_walk; +extern const mmove_t gunner_move_attack_chain; +extern const mmove_t gunner_move_attack_grenade; +extern const mmove_t gunner_move_death; +extern const mmove_t gunner_move_duck; +extern const mmove_t gunner_move_endfire_chain; +extern const mmove_t gunner_move_fidget; +extern const mmove_t gunner_move_fire_chain; +extern const mmove_t gunner_move_pain1; +extern const mmove_t gunner_move_pain2; +extern const mmove_t gunner_move_pain3; +extern const mmove_t gunner_move_run; +extern const mmove_t gunner_move_runandshoot; +extern const mmove_t gunner_move_stand; +extern const mmove_t gunner_move_walk; +extern const mmove_t hover_move_attack1; +extern const mmove_t hover_move_death1; +extern const mmove_t hover_move_end_attack; +extern const mmove_t hover_move_pain1; +extern const mmove_t hover_move_pain2; +extern const mmove_t hover_move_pain3; +extern const mmove_t hover_move_run; +extern const mmove_t hover_move_stand; +extern const mmove_t hover_move_start_attack; +extern const mmove_t hover_move_walk; +extern const mmove_t infantry_move_attack1; +extern const mmove_t infantry_move_attack2; +extern const mmove_t infantry_move_death1; +extern const mmove_t infantry_move_death2; +extern const mmove_t infantry_move_death3; +extern const mmove_t infantry_move_duck; +extern const mmove_t infantry_move_fidget; +extern const mmove_t infantry_move_pain1; +extern const mmove_t infantry_move_pain2; +extern const mmove_t infantry_move_run; +extern const mmove_t infantry_move_stand; +extern const mmove_t infantry_move_walk; +extern const mmove_t insane_move_crawl; +extern const mmove_t insane_move_crawl_death; +extern const mmove_t insane_move_crawl_pain; +extern const mmove_t insane_move_cross; +extern const mmove_t insane_move_down; +extern const mmove_t insane_move_downtoup; +extern const mmove_t insane_move_jumpdown; +extern const mmove_t insane_move_run_insane; +extern const mmove_t insane_move_run_normal; +extern const mmove_t insane_move_runcrawl; +extern const mmove_t insane_move_stand_death; +extern const mmove_t insane_move_stand_insane; +extern const mmove_t insane_move_stand_normal; +extern const mmove_t insane_move_stand_pain; +extern const mmove_t insane_move_struggle_cross; +extern const mmove_t insane_move_uptodown; +extern const mmove_t insane_move_walk_insane; +extern const mmove_t insane_move_walk_normal; +extern const mmove_t jorg_move_attack1; +extern const mmove_t jorg_move_attack2; +extern const mmove_t jorg_move_death; +extern const mmove_t jorg_move_end_attack1; +extern const mmove_t jorg_move_pain1; +extern const mmove_t jorg_move_pain2; +extern const mmove_t jorg_move_pain3; +extern const mmove_t jorg_move_run; +extern const mmove_t jorg_move_stand; +extern const mmove_t jorg_move_start_attack1; +extern const mmove_t jorg_move_walk; +extern const mmove_t makron_move_attack3; +extern const mmove_t makron_move_attack4; +extern const mmove_t makron_move_attack5; +extern const mmove_t makron_move_death2; +extern const mmove_t makron_move_pain4; +extern const mmove_t makron_move_pain5; +extern const mmove_t makron_move_pain6; +extern const mmove_t makron_move_run; +extern const mmove_t makron_move_sight; +extern const mmove_t makron_move_stand; +extern const mmove_t makron_move_walk; +extern const mmove_t medic_move_attackBlaster; +extern const mmove_t medic_move_attackCable; +extern const mmove_t medic_move_attackHyperBlaster; +extern const mmove_t medic_move_death; +extern const mmove_t medic_move_duck; +extern const mmove_t medic_move_pain1; +extern const mmove_t medic_move_pain2; +extern const mmove_t medic_move_run; +extern const mmove_t medic_move_stand; +extern const mmove_t medic_move_walk; +extern const mmove_t mutant_move_attack; +extern const mmove_t mutant_move_death1; +extern const mmove_t mutant_move_death2; +extern const mmove_t mutant_move_idle; +extern const mmove_t mutant_move_jump; +extern const mmove_t mutant_move_pain1; +extern const mmove_t mutant_move_pain2; +extern const mmove_t mutant_move_pain3; +extern const mmove_t mutant_move_run; +extern const mmove_t mutant_move_stand; +extern const mmove_t mutant_move_start_walk; +extern const mmove_t mutant_move_walk; +extern const mmove_t parasite_move_death; +extern const mmove_t parasite_move_drain; +extern const mmove_t parasite_move_end_fidget; +extern const mmove_t parasite_move_fidget; +extern const mmove_t parasite_move_pain1; +extern const mmove_t parasite_move_run; +extern const mmove_t parasite_move_stand; +extern const mmove_t parasite_move_start_fidget; +extern const mmove_t parasite_move_start_run; +extern const mmove_t parasite_move_start_walk; +extern const mmove_t parasite_move_walk; +extern const mmove_t soldier_move_attack1; +extern const mmove_t soldier_move_attack2; +extern const mmove_t soldier_move_attack3; +extern const mmove_t soldier_move_attack4; +extern const mmove_t soldier_move_attack6; +extern const mmove_t soldier_move_death1; +extern const mmove_t soldier_move_death2; +extern const mmove_t soldier_move_death3; +extern const mmove_t soldier_move_death4; +extern const mmove_t soldier_move_death5; +extern const mmove_t soldier_move_death6; +extern const mmove_t soldier_move_duck; +extern const mmove_t soldier_move_pain1; +extern const mmove_t soldier_move_pain2; +extern const mmove_t soldier_move_pain3; +extern const mmove_t soldier_move_pain4; +extern const mmove_t soldier_move_run; +extern const mmove_t soldier_move_stand1; +extern const mmove_t soldier_move_stand3; +extern const mmove_t soldier_move_start_run; +extern const mmove_t soldier_move_walk1; +extern const mmove_t soldier_move_walk2; +extern const mmove_t supertank_move_attack1; +extern const mmove_t supertank_move_attack2; +extern const mmove_t supertank_move_death; +extern const mmove_t supertank_move_end_attack1; +extern const mmove_t supertank_move_forward; +extern const mmove_t supertank_move_pain1; +extern const mmove_t supertank_move_pain2; +extern const mmove_t supertank_move_pain3; +extern const mmove_t supertank_move_run; +extern const mmove_t supertank_move_stand; +extern const mmove_t tank_move_attack_blast; +extern const mmove_t tank_move_attack_chain; +extern const mmove_t tank_move_attack_fire_rocket; +extern const mmove_t tank_move_attack_post_blast; +extern const mmove_t tank_move_attack_post_rocket; +extern const mmove_t tank_move_attack_pre_rocket; +extern const mmove_t tank_move_attack_strike; +extern const mmove_t tank_move_death; +extern const mmove_t tank_move_pain1; +extern const mmove_t tank_move_pain2; +extern const mmove_t tank_move_pain3; +extern const mmove_t tank_move_reattack_blast; +extern const mmove_t tank_move_run; +extern const mmove_t tank_move_stand; +extern const mmove_t tank_move_start_run; +extern const mmove_t tank_move_walk; extern void actor_attack(edict_t *); extern void actor_die(edict_t *, edict_t *, edict_t *, int, vec3_t); extern void actor_pain(edict_t *, edict_t *, float, int); diff --git a/src/baseq2/g_ptrs.h b/src/baseq2/g_ptrs.h index 2f5cdd333..a833b0339 100644 --- a/src/baseq2/g_ptrs.h +++ b/src/baseq2/g_ptrs.h @@ -26,7 +26,7 @@ typedef enum { typedef struct { ptr_type_t type; - void *ptr; + const void *ptr; } save_ptr_t; extern const save_ptr_t save_ptrs[]; diff --git a/src/baseq2/g_save.c b/src/baseq2/g_save.c index 57f1d4126..4d6d23395 100644 --- a/src/baseq2/g_save.c +++ b/src/baseq2/g_save.c @@ -739,7 +739,7 @@ static void *read_pointer(game_read_context_t* ctx, ptr_type_t type) gi.error("%s: type mismatch", __func__); } - return ptr->ptr; + return (void *)ptr->ptr; } static void read_field(game_read_context_t* ctx, const save_field_t *field, void *base) diff --git a/src/baseq2/genptr.py b/src/baseq2/genptr.py index 41967d524..a765d0e65 100755 --- a/src/baseq2/genptr.py +++ b/src/baseq2/genptr.py @@ -12,7 +12,7 @@ 'pain' : 'void {p}(edict_t *, edict_t *, float, int)', 'die' : 'void {p}(edict_t *, edict_t *, edict_t *, int, vec3_t)', 'moveinfo_endfunc' : 'void {p}(edict_t *)', - 'monsterinfo_currentmove' : 'mmove_t {p}', + 'monsterinfo_currentmove' : 'const mmove_t {p}', 'monsterinfo_stand' : 'void {p}(edict_t *)', 'monsterinfo_idle' : 'void {p}(edict_t *)', 'monsterinfo_search' : 'void {p}(edict_t *)', diff --git a/src/baseq2/m_actor.c b/src/baseq2/m_actor.c index bdc8f2faa..dc81a48b1 100644 --- a/src/baseq2/m_actor.c +++ b/src/baseq2/m_actor.c @@ -33,7 +33,7 @@ char *actor_names[MAX_ACTOR_NAMES] = { }; -mframe_t actor_frames_stand [] = { +static const mframe_t actor_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -78,7 +78,7 @@ mframe_t actor_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t actor_move_stand = {FRAME_stand101, FRAME_stand140, actor_frames_stand, NULL}; +const mmove_t actor_move_stand = {FRAME_stand101, FRAME_stand140, actor_frames_stand, NULL}; void actor_stand(edict_t *self) { @@ -90,7 +90,7 @@ void actor_stand(edict_t *self) } -mframe_t actor_frames_walk [] = { +static const mframe_t actor_frames_walk [] = { { ai_walk, 0, NULL }, { ai_walk, 6, NULL }, { ai_walk, 10, NULL }, @@ -103,7 +103,7 @@ mframe_t actor_frames_walk [] = { { ai_walk, 0, NULL }, { ai_walk, 0, NULL } }; -mmove_t actor_move_walk = {FRAME_walk01, FRAME_walk08, actor_frames_walk, NULL}; +const mmove_t actor_move_walk = {FRAME_walk01, FRAME_walk08, actor_frames_walk, NULL}; void actor_walk(edict_t *self) { @@ -111,7 +111,7 @@ void actor_walk(edict_t *self) } -mframe_t actor_frames_run [] = { +static const mframe_t actor_frames_run [] = { { ai_run, 4, NULL }, { ai_run, 15, NULL }, { ai_run, 15, NULL }, @@ -125,7 +125,7 @@ mframe_t actor_frames_run [] = { { ai_run, -2, NULL }, { ai_run, -1, NULL } }; -mmove_t actor_move_run = {FRAME_run02, FRAME_run07, actor_frames_run, NULL}; +const mmove_t actor_move_run = {FRAME_run02, FRAME_run07, actor_frames_run, NULL}; void actor_run(edict_t *self) { @@ -146,28 +146,28 @@ void actor_run(edict_t *self) } -mframe_t actor_frames_pain1 [] = { +static const mframe_t actor_frames_pain1 [] = { { ai_move, -5, NULL }, { ai_move, 4, NULL }, { ai_move, 1, NULL } }; -mmove_t actor_move_pain1 = {FRAME_pain101, FRAME_pain103, actor_frames_pain1, actor_run}; +const mmove_t actor_move_pain1 = {FRAME_pain101, FRAME_pain103, actor_frames_pain1, actor_run}; -mframe_t actor_frames_pain2 [] = { +static const mframe_t actor_frames_pain2 [] = { { ai_move, -4, NULL }, { ai_move, 4, NULL }, { ai_move, 0, NULL } }; -mmove_t actor_move_pain2 = {FRAME_pain201, FRAME_pain203, actor_frames_pain2, actor_run}; +const mmove_t actor_move_pain2 = {FRAME_pain201, FRAME_pain203, actor_frames_pain2, actor_run}; -mframe_t actor_frames_pain3 [] = { +static const mframe_t actor_frames_pain3 [] = { { ai_move, -1, NULL }, { ai_move, 1, NULL }, { ai_move, 0, NULL } }; -mmove_t actor_move_pain3 = {FRAME_pain301, FRAME_pain303, actor_frames_pain3, actor_run}; +const mmove_t actor_move_pain3 = {FRAME_pain301, FRAME_pain303, actor_frames_pain3, actor_run}; -mframe_t actor_frames_flipoff [] = { +static const mframe_t actor_frames_flipoff [] = { { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, @@ -183,9 +183,9 @@ mframe_t actor_frames_flipoff [] = { { ai_turn, 0, NULL }, { ai_turn, 0, NULL } }; -mmove_t actor_move_flipoff = {FRAME_flip01, FRAME_flip14, actor_frames_flipoff, actor_run}; +const mmove_t actor_move_flipoff = {FRAME_flip01, FRAME_flip14, actor_frames_flipoff, actor_run}; -mframe_t actor_frames_taunt [] = { +static const mframe_t actor_frames_taunt [] = { { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, @@ -204,7 +204,7 @@ mframe_t actor_frames_taunt [] = { { ai_turn, 0, NULL }, { ai_turn, 0, NULL } }; -mmove_t actor_move_taunt = {FRAME_taunt01, FRAME_taunt17, actor_frames_taunt, actor_run}; +const mmove_t actor_move_taunt = {FRAME_taunt01, FRAME_taunt17, actor_frames_taunt, actor_run}; char *messages[] = { "Watch it", @@ -285,7 +285,7 @@ void actor_dead(edict_t *self) gi.linkentity(self); } -mframe_t actor_frames_death1 [] = { +static const mframe_t actor_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, -13, NULL }, @@ -294,9 +294,9 @@ mframe_t actor_frames_death1 [] = { { ai_move, -2, NULL }, { ai_move, 1, NULL } }; -mmove_t actor_move_death1 = {FRAME_death101, FRAME_death107, actor_frames_death1, actor_dead}; +const mmove_t actor_move_death1 = {FRAME_death101, FRAME_death107, actor_frames_death1, actor_dead}; -mframe_t actor_frames_death2 [] = { +static const mframe_t actor_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 7, NULL }, { ai_move, -6, NULL }, @@ -311,7 +311,7 @@ mframe_t actor_frames_death2 [] = { { ai_move, -13, NULL }, { ai_move, 0, NULL } }; -mmove_t actor_move_death2 = {FRAME_death201, FRAME_death213, actor_frames_death2, actor_dead}; +const mmove_t actor_move_death2 = {FRAME_death201, FRAME_death213, actor_frames_death2, actor_dead}; void actor_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { @@ -355,13 +355,13 @@ void actor_fire(edict_t *self) self->monsterinfo.aiflags |= AI_HOLD_FRAME; } -mframe_t actor_frames_attack [] = { +static const mframe_t actor_frames_attack [] = { { ai_charge, -2, actor_fire }, { ai_charge, -2, NULL }, { ai_charge, 3, NULL }, { ai_charge, 2, NULL } }; -mmove_t actor_move_attack = {FRAME_attak01, FRAME_attak04, actor_frames_attack, actor_run}; +const mmove_t actor_move_attack = {FRAME_attak01, FRAME_attak04, actor_frames_attack, actor_run}; void actor_attack(edict_t *self) { diff --git a/src/baseq2/m_berserk.c b/src/baseq2/m_berserk.c index b6a4bef90..67005e7b7 100644 --- a/src/baseq2/m_berserk.c +++ b/src/baseq2/m_berserk.c @@ -46,21 +46,21 @@ void berserk_search(edict_t *self) void berserk_fidget(edict_t *self); -mframe_t berserk_frames_stand [] = { +static const mframe_t berserk_frames_stand [] = { { ai_stand, 0, berserk_fidget }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t berserk_move_stand = {FRAME_stand1, FRAME_stand5, berserk_frames_stand, NULL}; +const mmove_t berserk_move_stand = {FRAME_stand1, FRAME_stand5, berserk_frames_stand, NULL}; void berserk_stand(edict_t *self) { self->monsterinfo.currentmove = &berserk_move_stand; } -mframe_t berserk_frames_stand_fidget [] = { +static const mframe_t berserk_frames_stand_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -82,7 +82,7 @@ mframe_t berserk_frames_stand_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t berserk_move_stand_fidget = {FRAME_standb1, FRAME_standb20, berserk_frames_stand_fidget, berserk_stand}; +const mmove_t berserk_move_stand_fidget = {FRAME_standb1, FRAME_standb20, berserk_frames_stand_fidget, berserk_stand}; void berserk_fidget(edict_t *self) { @@ -96,7 +96,7 @@ void berserk_fidget(edict_t *self) } -mframe_t berserk_frames_walk [] = { +static const mframe_t berserk_frames_walk [] = { { ai_walk, 9.1, NULL }, { ai_walk, 6.3, NULL }, { ai_walk, 4.9, NULL }, @@ -110,7 +110,7 @@ mframe_t berserk_frames_walk [] = { { ai_walk, 4.7, NULL }, { ai_walk, 4.8, NULL } }; -mmove_t berserk_move_walk = {FRAME_walkc1, FRAME_walkc11, berserk_frames_walk, NULL}; +const mmove_t berserk_move_walk = {FRAME_walkc1, FRAME_walkc11, berserk_frames_walk, NULL}; void berserk_walk(edict_t *self) { @@ -142,7 +142,7 @@ void() berserk_runb12 =[ $r_att12 , berserk_runb7 ] {{ ai_run(19);}; */ -mframe_t berserk_frames_run1 [] = { +static const mframe_t berserk_frames_run1 [] = { { ai_run, 21, NULL }, { ai_run, 11, NULL }, { ai_run, 21, NULL }, @@ -150,7 +150,7 @@ mframe_t berserk_frames_run1 [] = { { ai_run, 18, NULL }, { ai_run, 19, NULL } }; -mmove_t berserk_move_run1 = {FRAME_run1, FRAME_run6, berserk_frames_run1, NULL}; +const mmove_t berserk_move_run1 = {FRAME_run1, FRAME_run6, berserk_frames_run1, NULL}; void berserk_run(edict_t *self) { @@ -173,7 +173,7 @@ void berserk_swing(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_punch, 1, ATTN_NORM, 0); } -mframe_t berserk_frames_attack_spike [] = { +static const mframe_t berserk_frames_attack_spike [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, berserk_swing }, @@ -183,7 +183,7 @@ mframe_t berserk_frames_attack_spike [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t berserk_move_attack_spike = {FRAME_att_c1, FRAME_att_c8, berserk_frames_attack_spike, berserk_run}; +const mmove_t berserk_move_attack_spike = {FRAME_att_c1, FRAME_att_c8, berserk_frames_attack_spike, berserk_run}; void berserk_attack_club(edict_t *self) @@ -194,7 +194,7 @@ void berserk_attack_club(edict_t *self) fire_hit(self, aim, (5 + (Q_rand() % 6)), 400); // Slower attack } -mframe_t berserk_frames_attack_club [] = { +static const mframe_t berserk_frames_attack_club [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -208,7 +208,7 @@ mframe_t berserk_frames_attack_club [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t berserk_move_attack_club = {FRAME_att_c9, FRAME_att_c20, berserk_frames_attack_club, berserk_run}; +const mmove_t berserk_move_attack_club = {FRAME_att_c9, FRAME_att_c20, berserk_frames_attack_club, berserk_run}; void berserk_strike(edict_t *self) @@ -217,7 +217,7 @@ void berserk_strike(edict_t *self) } -mframe_t berserk_frames_attack_strike [] = { +static const mframe_t berserk_frames_attack_strike [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -234,7 +234,7 @@ mframe_t berserk_frames_attack_strike [] = { { ai_move, 13.6, NULL } }; -mmove_t berserk_move_attack_strike = {FRAME_att_c21, FRAME_att_c34, berserk_frames_attack_strike, berserk_run}; +const mmove_t berserk_move_attack_strike = {FRAME_att_c21, FRAME_att_c34, berserk_frames_attack_strike, berserk_run}; void berserk_melee(edict_t *self) @@ -268,16 +268,16 @@ void() berserk_atke18 =[ $r_attb18, berserk_run1 ] {{ ai_run(7.8);}; */ -mframe_t berserk_frames_pain1 [] = { +static const mframe_t berserk_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t berserk_move_pain1 = {FRAME_painc1, FRAME_painc4, berserk_frames_pain1, berserk_run}; +const mmove_t berserk_move_pain1 = {FRAME_painc1, FRAME_painc4, berserk_frames_pain1, berserk_run}; -mframe_t berserk_frames_pain2 [] = { +static const mframe_t berserk_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -299,7 +299,7 @@ mframe_t berserk_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t berserk_move_pain2 = {FRAME_painb1, FRAME_painb20, berserk_frames_pain2, berserk_run}; +const mmove_t berserk_move_pain2 = {FRAME_painb1, FRAME_painb20, berserk_frames_pain2, berserk_run}; void berserk_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -333,7 +333,7 @@ void berserk_dead(edict_t *self) } -mframe_t berserk_frames_death1 [] = { +static const mframe_t berserk_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -349,10 +349,10 @@ mframe_t berserk_frames_death1 [] = { { ai_move, 0, NULL } }; -mmove_t berserk_move_death1 = {FRAME_death1, FRAME_death13, berserk_frames_death1, berserk_dead}; +const mmove_t berserk_move_death1 = {FRAME_death1, FRAME_death13, berserk_frames_death1, berserk_dead}; -mframe_t berserk_frames_death2 [] = { +static const mframe_t berserk_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -362,7 +362,7 @@ mframe_t berserk_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t berserk_move_death2 = {FRAME_deathc1, FRAME_deathc8, berserk_frames_death2, berserk_dead}; +const mmove_t berserk_move_death2 = {FRAME_deathc1, FRAME_deathc8, berserk_frames_death2, berserk_dead}; void berserk_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) diff --git a/src/baseq2/m_boss2.c b/src/baseq2/m_boss2.c index 30deabad4..ee0cc78d7 100644 --- a/src/baseq2/m_boss2.c +++ b/src/baseq2/m_boss2.c @@ -132,7 +132,7 @@ void Boss2MachineGun(edict_t *self) } -mframe_t boss2_frames_stand [] = { +static const mframe_t boss2_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -155,9 +155,9 @@ mframe_t boss2_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t boss2_move_stand = {FRAME_stand30, FRAME_stand50, boss2_frames_stand, NULL}; +const mmove_t boss2_move_stand = {FRAME_stand30, FRAME_stand50, boss2_frames_stand, NULL}; -mframe_t boss2_frames_fidget [] = { +static const mframe_t boss2_frames_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -189,9 +189,9 @@ mframe_t boss2_frames_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t boss2_move_fidget = {FRAME_stand1, FRAME_stand30, boss2_frames_fidget, NULL}; +const mmove_t boss2_move_fidget = {FRAME_stand1, FRAME_stand30, boss2_frames_fidget, NULL}; -mframe_t boss2_frames_walk [] = { +static const mframe_t boss2_frames_walk [] = { { ai_walk, 8, NULL }, { ai_walk, 8, NULL }, { ai_walk, 8, NULL }, @@ -213,10 +213,10 @@ mframe_t boss2_frames_walk [] = { { ai_walk, 8, NULL }, { ai_walk, 8, NULL } }; -mmove_t boss2_move_walk = {FRAME_walk1, FRAME_walk20, boss2_frames_walk, NULL}; +const mmove_t boss2_move_walk = {FRAME_walk1, FRAME_walk20, boss2_frames_walk, NULL}; -mframe_t boss2_frames_run [] = { +static const mframe_t boss2_frames_run [] = { { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, NULL }, @@ -238,9 +238,9 @@ mframe_t boss2_frames_run [] = { { ai_run, 8, NULL }, { ai_run, 8, NULL } }; -mmove_t boss2_move_run = {FRAME_walk1, FRAME_walk20, boss2_frames_run, NULL}; +const mmove_t boss2_move_run = {FRAME_walk1, FRAME_walk20, boss2_frames_run, NULL}; -mframe_t boss2_frames_attack_pre_mg [] = { +static const mframe_t boss2_frames_attack_pre_mg [] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, @@ -251,11 +251,11 @@ mframe_t boss2_frames_attack_pre_mg [] = { { ai_charge, 1, NULL }, { ai_charge, 1, boss2_attack_mg } }; -mmove_t boss2_move_attack_pre_mg = {FRAME_attack1, FRAME_attack9, boss2_frames_attack_pre_mg, NULL}; +const mmove_t boss2_move_attack_pre_mg = {FRAME_attack1, FRAME_attack9, boss2_frames_attack_pre_mg, NULL}; // Loop this -mframe_t boss2_frames_attack_mg [] = { +static const mframe_t boss2_frames_attack_mg [] = { { ai_charge, 1, Boss2MachineGun }, { ai_charge, 1, Boss2MachineGun }, { ai_charge, 1, Boss2MachineGun }, @@ -263,17 +263,17 @@ mframe_t boss2_frames_attack_mg [] = { { ai_charge, 1, Boss2MachineGun }, { ai_charge, 1, boss2_reattack_mg } }; -mmove_t boss2_move_attack_mg = {FRAME_attack10, FRAME_attack15, boss2_frames_attack_mg, NULL}; +const mmove_t boss2_move_attack_mg = {FRAME_attack10, FRAME_attack15, boss2_frames_attack_mg, NULL}; -mframe_t boss2_frames_attack_post_mg [] = { +static const mframe_t boss2_frames_attack_post_mg [] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL } }; -mmove_t boss2_move_attack_post_mg = {FRAME_attack16, FRAME_attack19, boss2_frames_attack_post_mg, boss2_run}; +const mmove_t boss2_move_attack_post_mg = {FRAME_attack16, FRAME_attack19, boss2_frames_attack_post_mg, boss2_run}; -mframe_t boss2_frames_attack_rocket [] = { +static const mframe_t boss2_frames_attack_rocket [] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, @@ -296,9 +296,9 @@ mframe_t boss2_frames_attack_rocket [] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL } }; -mmove_t boss2_move_attack_rocket = {FRAME_attack20, FRAME_attack40, boss2_frames_attack_rocket, boss2_run}; +const mmove_t boss2_move_attack_rocket = {FRAME_attack20, FRAME_attack40, boss2_frames_attack_rocket, boss2_run}; -mframe_t boss2_frames_pain_heavy [] = { +static const mframe_t boss2_frames_pain_heavy [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -318,17 +318,17 @@ mframe_t boss2_frames_pain_heavy [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t boss2_move_pain_heavy = {FRAME_pain2, FRAME_pain19, boss2_frames_pain_heavy, boss2_run}; +const mmove_t boss2_move_pain_heavy = {FRAME_pain2, FRAME_pain19, boss2_frames_pain_heavy, boss2_run}; -mframe_t boss2_frames_pain_light [] = { +static const mframe_t boss2_frames_pain_light [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t boss2_move_pain_light = {FRAME_pain20, FRAME_pain23, boss2_frames_pain_light, boss2_run}; +const mmove_t boss2_move_pain_light = {FRAME_pain20, FRAME_pain23, boss2_frames_pain_light, boss2_run}; -mframe_t boss2_frames_death [] = { +static const mframe_t boss2_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -379,7 +379,7 @@ mframe_t boss2_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, BossExplode } }; -mmove_t boss2_move_death = {FRAME_death2, FRAME_death50, boss2_frames_death, boss2_dead}; +const mmove_t boss2_move_death = {FRAME_death2, FRAME_death50, boss2_frames_death, boss2_dead}; void boss2_stand(edict_t *self) { diff --git a/src/baseq2/m_boss31.c b/src/baseq2/m_boss31.c index 8c7bd944e..c6d87df3c 100644 --- a/src/baseq2/m_boss31.c +++ b/src/baseq2/m_boss31.c @@ -78,7 +78,7 @@ void jorg_death_hit(edict_t *self); // stand // -mframe_t jorg_frames_stand [] = { +static const mframe_t jorg_frames_stand [] = { { ai_stand, 0, jorg_idle }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -131,7 +131,7 @@ mframe_t jorg_frames_stand [] = { { ai_stand, -12, NULL }, // 50 { ai_stand, -14, jorg_step_right } // 51 }; -mmove_t jorg_move_stand = {FRAME_stand01, FRAME_stand51, jorg_frames_stand, NULL}; +const mmove_t jorg_move_stand = {FRAME_stand01, FRAME_stand51, jorg_frames_stand, NULL}; void jorg_idle(edict_t *self) { @@ -160,7 +160,7 @@ void jorg_stand(edict_t *self) self->monsterinfo.currentmove = &jorg_move_stand; } -mframe_t jorg_frames_run [] = { +static const mframe_t jorg_frames_run [] = { { ai_run, 17, jorg_step_left }, { ai_run, 0, NULL }, { ai_run, 0, NULL }, @@ -176,22 +176,22 @@ mframe_t jorg_frames_run [] = { { ai_run, 9, NULL }, { ai_run, 9, NULL } }; -mmove_t jorg_move_run = {FRAME_walk06, FRAME_walk19, jorg_frames_run, NULL}; +const mmove_t jorg_move_run = {FRAME_walk06, FRAME_walk19, jorg_frames_run, NULL}; // // walk // -mframe_t jorg_frames_start_walk [] = { +static const mframe_t jorg_frames_start_walk [] = { { ai_walk, 5, NULL }, { ai_walk, 6, NULL }, { ai_walk, 7, NULL }, { ai_walk, 9, NULL }, { ai_walk, 15, NULL } }; -mmove_t jorg_move_start_walk = {FRAME_walk01, FRAME_walk05, jorg_frames_start_walk, NULL}; +const mmove_t jorg_move_start_walk = {FRAME_walk01, FRAME_walk05, jorg_frames_start_walk, NULL}; -mframe_t jorg_frames_walk [] = { +static const mframe_t jorg_frames_walk [] = { { ai_walk, 17, NULL }, { ai_walk, 0, NULL }, { ai_walk, 0, NULL }, @@ -207,9 +207,9 @@ mframe_t jorg_frames_walk [] = { { ai_walk, 9, NULL }, { ai_walk, 9, NULL } }; -mmove_t jorg_move_walk = {FRAME_walk06, FRAME_walk19, jorg_frames_walk, NULL}; +const mmove_t jorg_move_walk = {FRAME_walk06, FRAME_walk19, jorg_frames_walk, NULL}; -mframe_t jorg_frames_end_walk [] = { +static const mframe_t jorg_frames_end_walk [] = { { ai_walk, 11, NULL }, { ai_walk, 0, NULL }, { ai_walk, 0, NULL }, @@ -217,7 +217,7 @@ mframe_t jorg_frames_end_walk [] = { { ai_walk, 8, NULL }, { ai_walk, -8, NULL } }; -mmove_t jorg_move_end_walk = {FRAME_walk20, FRAME_walk25, jorg_frames_end_walk, NULL}; +const mmove_t jorg_move_end_walk = {FRAME_walk20, FRAME_walk25, jorg_frames_end_walk, NULL}; void jorg_walk(edict_t *self) { @@ -232,7 +232,7 @@ void jorg_run(edict_t *self) self->monsterinfo.currentmove = &jorg_move_run; } -mframe_t jorg_frames_pain3 [] = { +static const mframe_t jorg_frames_pain3 [] = { { ai_move, -28, NULL }, { ai_move, -6, NULL }, { ai_move, -3, jorg_step_left }, @@ -259,23 +259,23 @@ mframe_t jorg_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, jorg_step_right } }; -mmove_t jorg_move_pain3 = {FRAME_pain301, FRAME_pain325, jorg_frames_pain3, jorg_run}; +const mmove_t jorg_move_pain3 = {FRAME_pain301, FRAME_pain325, jorg_frames_pain3, jorg_run}; -mframe_t jorg_frames_pain2 [] = { +static const mframe_t jorg_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t jorg_move_pain2 = {FRAME_pain201, FRAME_pain203, jorg_frames_pain2, jorg_run}; +const mmove_t jorg_move_pain2 = {FRAME_pain201, FRAME_pain203, jorg_frames_pain2, jorg_run}; -mframe_t jorg_frames_pain1 [] = { +static const mframe_t jorg_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t jorg_move_pain1 = {FRAME_pain101, FRAME_pain103, jorg_frames_pain1, jorg_run}; +const mmove_t jorg_move_pain1 = {FRAME_pain101, FRAME_pain103, jorg_frames_pain1, jorg_run}; -mframe_t jorg_frames_death1 [] = { +static const mframe_t jorg_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -327,9 +327,9 @@ mframe_t jorg_frames_death1 [] = { { ai_move, 0, MakronToss }, { ai_move, 0, BossExplode } // 50 }; -mmove_t jorg_move_death = {FRAME_death01, FRAME_death50, jorg_frames_death1, jorg_dead}; +const mmove_t jorg_move_death = {FRAME_death01, FRAME_death50, jorg_frames_death1, jorg_dead}; -mframe_t jorg_frames_attack2 [] = { +static const mframe_t jorg_frames_attack2 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -344,9 +344,9 @@ mframe_t jorg_frames_attack2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t jorg_move_attack2 = {FRAME_attak201, FRAME_attak213, jorg_frames_attack2, jorg_run}; +const mmove_t jorg_move_attack2 = {FRAME_attak201, FRAME_attak213, jorg_frames_attack2, jorg_run}; -mframe_t jorg_frames_start_attack1 [] = { +static const mframe_t jorg_frames_start_attack1 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -356,9 +356,9 @@ mframe_t jorg_frames_start_attack1 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t jorg_move_start_attack1 = {FRAME_attak101, FRAME_attak108, jorg_frames_start_attack1, jorg_attack1}; +const mmove_t jorg_move_start_attack1 = {FRAME_attak101, FRAME_attak108, jorg_frames_start_attack1, jorg_attack1}; -mframe_t jorg_frames_attack1[] = { +static const mframe_t jorg_frames_attack1[] = { { ai_charge, 0, jorg_firebullet }, { ai_charge, 0, jorg_firebullet }, { ai_charge, 0, jorg_firebullet }, @@ -366,15 +366,15 @@ mframe_t jorg_frames_attack1[] = { { ai_charge, 0, jorg_firebullet }, { ai_charge, 0, jorg_firebullet } }; -mmove_t jorg_move_attack1 = {FRAME_attak109, FRAME_attak114, jorg_frames_attack1, jorg_reattack1}; +const mmove_t jorg_move_attack1 = {FRAME_attak109, FRAME_attak114, jorg_frames_attack1, jorg_reattack1}; -mframe_t jorg_frames_end_attack1[] = { +static const mframe_t jorg_frames_end_attack1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t jorg_move_end_attack1 = {FRAME_attak115, FRAME_attak118, jorg_frames_end_attack1, jorg_run}; +const mmove_t jorg_move_end_attack1 = {FRAME_attak115, FRAME_attak118, jorg_frames_end_attack1, jorg_run}; void jorg_reattack1(edict_t *self) { diff --git a/src/baseq2/m_boss32.c b/src/baseq2/m_boss32.c index 8faa6371e..a305b9b2f 100644 --- a/src/baseq2/m_boss32.c +++ b/src/baseq2/m_boss32.c @@ -68,7 +68,7 @@ void makron_taunt(edict_t *self) // stand // -mframe_t makron_frames_stand [] = { +static const mframe_t makron_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -130,14 +130,14 @@ mframe_t makron_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } // 60 }; -mmove_t makron_move_stand = {FRAME_stand201, FRAME_stand260, makron_frames_stand, NULL}; +const mmove_t makron_move_stand = {FRAME_stand201, FRAME_stand260, makron_frames_stand, NULL}; void makron_stand(edict_t *self) { self->monsterinfo.currentmove = &makron_move_stand; } -mframe_t makron_frames_run [] = { +static const mframe_t makron_frames_run [] = { { ai_run, 3, makron_step_left }, { ai_run, 12, NULL }, { ai_run, 8, NULL }, @@ -149,7 +149,7 @@ mframe_t makron_frames_run [] = { { ai_run, 6, NULL }, { ai_run, 12, NULL } }; -mmove_t makron_move_run = {FRAME_walk204, FRAME_walk213, makron_frames_run, NULL}; +const mmove_t makron_move_run = {FRAME_walk204, FRAME_walk213, makron_frames_run, NULL}; void makron_hit(edict_t *self) { @@ -182,19 +182,7 @@ void makron_prerailgun(edict_t *self) } -mframe_t makron_frames_walk [] = { - { ai_walk, 3, makron_step_left }, - { ai_walk, 12, NULL }, - { ai_walk, 8, NULL }, - { ai_walk, 8, NULL }, - { ai_walk, 8, makron_step_right }, - { ai_walk, 6, NULL }, - { ai_walk, 12, NULL }, - { ai_walk, 9, NULL }, - { ai_walk, 6, NULL }, - { ai_walk, 12, NULL } -}; -mmove_t makron_move_walk = {FRAME_walk204, FRAME_walk213, makron_frames_run, NULL}; +const mmove_t makron_move_walk = {FRAME_walk204, FRAME_walk213, makron_frames_run, NULL}; void makron_walk(edict_t *self) { @@ -209,7 +197,7 @@ void makron_run(edict_t *self) self->monsterinfo.currentmove = &makron_move_run; } -mframe_t makron_frames_pain6 [] = { +static const mframe_t makron_frames_pain6 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -238,25 +226,25 @@ mframe_t makron_frames_pain6 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_pain6 = {FRAME_pain601, FRAME_pain627, makron_frames_pain6, makron_run}; +const mmove_t makron_move_pain6 = {FRAME_pain601, FRAME_pain627, makron_frames_pain6, makron_run}; -mframe_t makron_frames_pain5 [] = { +static const mframe_t makron_frames_pain5 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_pain5 = {FRAME_pain501, FRAME_pain504, makron_frames_pain5, makron_run}; +const mmove_t makron_move_pain5 = {FRAME_pain501, FRAME_pain504, makron_frames_pain5, makron_run}; -mframe_t makron_frames_pain4 [] = { +static const mframe_t makron_frames_pain4 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_pain4 = {FRAME_pain401, FRAME_pain404, makron_frames_pain4, makron_run}; +const mmove_t makron_move_pain4 = {FRAME_pain401, FRAME_pain404, makron_frames_pain4, makron_run}; -mframe_t makron_frames_death2 [] = { +static const mframe_t makron_frames_death2 [] = { { ai_move, -15, NULL }, { ai_move, 3, NULL }, { ai_move, -12, NULL }, @@ -353,9 +341,9 @@ mframe_t makron_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } // 95 }; -mmove_t makron_move_death2 = {FRAME_death201, FRAME_death295, makron_frames_death2, makron_dead}; +const mmove_t makron_move_death2 = {FRAME_death201, FRAME_death295, makron_frames_death2, makron_dead}; -mframe_t makron_frames_death3 [] = { +static const mframe_t makron_frames_death3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -377,9 +365,9 @@ mframe_t makron_frames_death3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_death3 = {FRAME_death301, FRAME_death320, makron_frames_death3, NULL}; +const mmove_t makron_move_death3 = {FRAME_death301, FRAME_death320, makron_frames_death3, NULL}; -mframe_t makron_frames_sight [] = { +static const mframe_t makron_frames_sight [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -394,7 +382,7 @@ mframe_t makron_frames_sight [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_sight = {FRAME_active01, FRAME_active13, makron_frames_sight, makron_run}; +const mmove_t makron_move_sight = {FRAME_active01, FRAME_active13, makron_frames_sight, makron_run}; void makronBFG(edict_t *self) { @@ -415,7 +403,7 @@ void makronBFG(edict_t *self) } -mframe_t makron_frames_attack3 [] = { +static const mframe_t makron_frames_attack3 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -425,9 +413,9 @@ mframe_t makron_frames_attack3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_attack3 = {FRAME_attak301, FRAME_attak308, makron_frames_attack3, makron_run}; +const mmove_t makron_move_attack3 = {FRAME_attak301, FRAME_attak308, makron_frames_attack3, makron_run}; -mframe_t makron_frames_attack4[] = { +static const mframe_t makron_frames_attack4[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -455,9 +443,9 @@ mframe_t makron_frames_attack4[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_attack4 = {FRAME_attak401, FRAME_attak426, makron_frames_attack4, makron_run}; +const mmove_t makron_move_attack4 = {FRAME_attak401, FRAME_attak426, makron_frames_attack4, makron_run}; -mframe_t makron_frames_attack5[] = { +static const mframe_t makron_frames_attack5[] = { { ai_charge, 0, makron_prerailgun }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -475,7 +463,7 @@ mframe_t makron_frames_attack5[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t makron_move_attack5 = {FRAME_attak501, FRAME_attak516, makron_frames_attack5, makron_run}; +const mmove_t makron_move_attack5 = {FRAME_attak501, FRAME_attak516, makron_frames_attack5, makron_run}; void MakronSaveloc(edict_t *self) { diff --git a/src/baseq2/m_brain.c b/src/baseq2/m_brain.c index 284f20916..5f926d240 100644 --- a/src/baseq2/m_brain.c +++ b/src/baseq2/m_brain.c @@ -62,7 +62,7 @@ void brain_dead(edict_t *self); // STAND // -mframe_t brain_frames_stand [] = { +static const mframe_t brain_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -96,7 +96,7 @@ mframe_t brain_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t brain_move_stand = {FRAME_stand01, FRAME_stand30, brain_frames_stand, NULL}; +const mmove_t brain_move_stand = {FRAME_stand01, FRAME_stand30, brain_frames_stand, NULL}; void brain_stand(edict_t *self) { @@ -108,7 +108,7 @@ void brain_stand(edict_t *self) // IDLE // -mframe_t brain_frames_idle [] = { +static const mframe_t brain_frames_idle [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -142,7 +142,7 @@ mframe_t brain_frames_idle [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t brain_move_idle = {FRAME_stand31, FRAME_stand60, brain_frames_idle, brain_stand}; +const mmove_t brain_move_idle = {FRAME_stand31, FRAME_stand60, brain_frames_idle, brain_stand}; void brain_idle(edict_t *self) { @@ -154,7 +154,7 @@ void brain_idle(edict_t *self) // // WALK // -mframe_t brain_frames_walk1 [] = { +static const mframe_t brain_frames_walk1 [] = { { ai_walk, 7, NULL }, { ai_walk, 2, NULL }, { ai_walk, 3, NULL }, @@ -167,7 +167,7 @@ mframe_t brain_frames_walk1 [] = { { ai_walk, -1, NULL }, { ai_walk, 2, NULL } }; -mmove_t brain_move_walk1 = {FRAME_walk101, FRAME_walk111, brain_frames_walk1, NULL}; +const mmove_t brain_move_walk1 = {FRAME_walk101, FRAME_walk111, brain_frames_walk1, NULL}; void brain_walk(edict_t *self) { self->monsterinfo.currentmove = &brain_move_walk1; @@ -175,7 +175,7 @@ void brain_walk(edict_t *self) { -mframe_t brain_frames_defense [] = +static const mframe_t brain_frames_defense [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -187,9 +187,9 @@ mframe_t brain_frames_defense [] = { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t brain_move_defense = {FRAME_defens01, FRAME_defens08, brain_frames_defense, NULL}; +const mmove_t brain_move_defense = {FRAME_defens01, FRAME_defens08, brain_frames_defense, NULL}; -mframe_t brain_frames_pain3 [] = +static const mframe_t brain_frames_pain3 [] = { { ai_move, -2, NULL }, { ai_move, 2, NULL }, @@ -198,9 +198,9 @@ mframe_t brain_frames_pain3 [] = { ai_move, 0, NULL }, { ai_move, -4, NULL } }; -mmove_t brain_move_pain3 = {FRAME_pain301, FRAME_pain306, brain_frames_pain3, brain_run}; +const mmove_t brain_move_pain3 = {FRAME_pain301, FRAME_pain306, brain_frames_pain3, brain_run}; -mframe_t brain_frames_pain2 [] = +static const mframe_t brain_frames_pain2 [] = { { ai_move, -2, NULL }, { ai_move, 0, NULL }, @@ -211,9 +211,9 @@ mframe_t brain_frames_pain2 [] = { ai_move, 1, NULL }, { ai_move, -2, NULL } }; -mmove_t brain_move_pain2 = {FRAME_pain201, FRAME_pain208, brain_frames_pain2, brain_run}; +const mmove_t brain_move_pain2 = {FRAME_pain201, FRAME_pain208, brain_frames_pain2, brain_run}; -mframe_t brain_frames_pain1 [] = +static const mframe_t brain_frames_pain1 [] = { { ai_move, -6, NULL }, { ai_move, -2, NULL }, @@ -237,7 +237,7 @@ mframe_t brain_frames_pain1 [] = { ai_move, 3, NULL }, { ai_move, -1, NULL } }; -mmove_t brain_move_pain1 = {FRAME_pain101, FRAME_pain121, brain_frames_pain1, brain_run}; +const mmove_t brain_move_pain1 = {FRAME_pain101, FRAME_pain121, brain_frames_pain1, brain_run}; // @@ -267,7 +267,7 @@ void brain_duck_up(edict_t *self) { gi.linkentity(self); } -mframe_t brain_frames_duck [] = +static const mframe_t brain_frames_duck [] = { { ai_move, 0, NULL }, { ai_move, -2, brain_duck_down }, @@ -278,7 +278,7 @@ mframe_t brain_frames_duck [] = { ai_move, -6, NULL }, { ai_move, -6, NULL } }; -mmove_t brain_move_duck = {FRAME_duck01, FRAME_duck08, brain_frames_duck, brain_run}; +const mmove_t brain_move_duck = {FRAME_duck01, FRAME_duck08, brain_frames_duck, brain_run}; void brain_dodge(edict_t *self, edict_t *attacker, float eta) { if (random() > 0.25f) @@ -292,7 +292,7 @@ void brain_dodge(edict_t *self, edict_t *attacker, float eta) { } -mframe_t brain_frames_death2 [] = +static const mframe_t brain_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -300,9 +300,9 @@ mframe_t brain_frames_death2 [] = { ai_move, 9, NULL }, { ai_move, 0, NULL } }; -mmove_t brain_move_death2 = {FRAME_death201, FRAME_death205, brain_frames_death2, brain_dead}; +const mmove_t brain_move_death2 = {FRAME_death201, FRAME_death205, brain_frames_death2, brain_dead}; -mframe_t brain_frames_death1 [] = +static const mframe_t brain_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -323,7 +323,7 @@ mframe_t brain_frames_death1 [] = { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t brain_move_death1 = {FRAME_death101, FRAME_death118, brain_frames_death1, brain_dead}; +const mmove_t brain_move_death1 = {FRAME_death101, FRAME_death118, brain_frames_death1, brain_dead}; // @@ -354,7 +354,7 @@ void brain_hit_left(edict_t *self) { gi.sound(self, CHAN_WEAPON, sound_melee3, 1, ATTN_NORM, 0); } -mframe_t brain_frames_attack1 [] = +static const mframe_t brain_frames_attack1 [] = { { ai_charge, 8, NULL }, { ai_charge, 3, NULL }, @@ -375,7 +375,7 @@ mframe_t brain_frames_attack1 [] = { ai_charge, 2, NULL }, { ai_charge, -11, NULL } }; -mmove_t brain_move_attack1 = {FRAME_attak101, FRAME_attak118, brain_frames_attack1, brain_run}; +const mmove_t brain_move_attack1 = {FRAME_attak101, FRAME_attak118, brain_frames_attack1, brain_run}; void brain_chest_open(edict_t *self) { self->spawnflags &= ~65536; @@ -400,7 +400,7 @@ void brain_chest_closed(edict_t *self) { } } -mframe_t brain_frames_attack2 [] = +static const mframe_t brain_frames_attack2 [] = { { ai_charge, 5, NULL }, { ai_charge, -4, NULL }, @@ -420,7 +420,7 @@ mframe_t brain_frames_attack2 [] = { ai_charge, -3, NULL }, { ai_charge, -6, NULL } }; -mmove_t brain_move_attack2 = {FRAME_attak201, FRAME_attak217, brain_frames_attack2, brain_run}; +const mmove_t brain_move_attack2 = {FRAME_attak201, FRAME_attak217, brain_frames_attack2, brain_run}; void brain_melee(edict_t *self) { if (random() <= 0.5f) @@ -434,7 +434,7 @@ void brain_melee(edict_t *self) { // RUN // -mframe_t brain_frames_run [] = +static const mframe_t brain_frames_run [] = { { ai_run, 9, NULL }, { ai_run, 2, NULL }, @@ -448,7 +448,7 @@ mframe_t brain_frames_run [] = { ai_run, -1, NULL }, { ai_run, 2, NULL } }; -mmove_t brain_move_run = {FRAME_walk101, FRAME_walk111, brain_frames_run, NULL}; +const mmove_t brain_move_run = {FRAME_walk101, FRAME_walk111, brain_frames_run, NULL}; void brain_run(edict_t *self) { self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN; diff --git a/src/baseq2/m_chick.c b/src/baseq2/m_chick.c index 6ea52c06f..21070b46c 100644 --- a/src/baseq2/m_chick.c +++ b/src/baseq2/m_chick.c @@ -59,7 +59,7 @@ void ChickMoan(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle2, 1, ATTN_IDLE, 0); } -mframe_t chick_frames_fidget [] = { +static const mframe_t chick_frames_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -91,7 +91,7 @@ mframe_t chick_frames_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t chick_move_fidget = {FRAME_stand201, FRAME_stand230, chick_frames_fidget, chick_stand}; +const mmove_t chick_move_fidget = {FRAME_stand201, FRAME_stand230, chick_frames_fidget, chick_stand}; void chick_fidget(edict_t *self) { @@ -101,7 +101,7 @@ void chick_fidget(edict_t *self) self->monsterinfo.currentmove = &chick_move_fidget; } -mframe_t chick_frames_stand [] = { +static const mframe_t chick_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -134,14 +134,14 @@ mframe_t chick_frames_stand [] = { { ai_stand, 0, chick_fidget }, }; -mmove_t chick_move_stand = {FRAME_stand101, FRAME_stand130, chick_frames_stand, NULL}; +const mmove_t chick_move_stand = {FRAME_stand101, FRAME_stand130, chick_frames_stand, NULL}; void chick_stand(edict_t *self) { self->monsterinfo.currentmove = &chick_move_stand; } -mframe_t chick_frames_start_run [] = { +static const mframe_t chick_frames_start_run [] = { { ai_run, 1, NULL }, { ai_run, 0, NULL }, { ai_run, 0, NULL }, @@ -153,9 +153,9 @@ mframe_t chick_frames_start_run [] = { { ai_run, 6, NULL }, { ai_run, 3, NULL } }; -mmove_t chick_move_start_run = {FRAME_walk01, FRAME_walk10, chick_frames_start_run, chick_run}; +const mmove_t chick_move_start_run = {FRAME_walk01, FRAME_walk10, chick_frames_start_run, chick_run}; -mframe_t chick_frames_run [] = { +static const mframe_t chick_frames_run [] = { { ai_run, 6, NULL }, { ai_run, 8, NULL }, { ai_run, 13, NULL }, @@ -169,9 +169,9 @@ mframe_t chick_frames_run [] = { }; -mmove_t chick_move_run = {FRAME_walk11, FRAME_walk20, chick_frames_run, NULL}; +const mmove_t chick_move_run = {FRAME_walk11, FRAME_walk20, chick_frames_run, NULL}; -mframe_t chick_frames_walk [] = { +static const mframe_t chick_frames_walk [] = { { ai_walk, 6, NULL }, { ai_walk, 8, NULL }, { ai_walk, 13, NULL }, @@ -184,7 +184,7 @@ mframe_t chick_frames_walk [] = { { ai_walk, 7, NULL } }; -mmove_t chick_move_walk = {FRAME_walk11, FRAME_walk20, chick_frames_walk, NULL}; +const mmove_t chick_move_walk = {FRAME_walk11, FRAME_walk20, chick_frames_walk, NULL}; void chick_walk(edict_t *self) { @@ -206,25 +206,25 @@ void chick_run(edict_t *self) } } -mframe_t chick_frames_pain1 [] = { +static const mframe_t chick_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t chick_move_pain1 = {FRAME_pain101, FRAME_pain105, chick_frames_pain1, chick_run}; +const mmove_t chick_move_pain1 = {FRAME_pain101, FRAME_pain105, chick_frames_pain1, chick_run}; -mframe_t chick_frames_pain2 [] = { +static const mframe_t chick_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t chick_move_pain2 = {FRAME_pain201, FRAME_pain205, chick_frames_pain2, chick_run}; +const mmove_t chick_move_pain2 = {FRAME_pain201, FRAME_pain205, chick_frames_pain2, chick_run}; -mframe_t chick_frames_pain3 [] = { +static const mframe_t chick_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, -6, NULL }, @@ -247,7 +247,7 @@ mframe_t chick_frames_pain3 [] = { { ai_move, -8, NULL }, { ai_move, 2, NULL } }; -mmove_t chick_move_pain3 = {FRAME_pain301, FRAME_pain321, chick_frames_pain3, chick_run}; +const mmove_t chick_move_pain3 = {FRAME_pain301, FRAME_pain321, chick_frames_pain3, chick_run}; void chick_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -290,7 +290,7 @@ void chick_dead(edict_t *self) gi.linkentity(self); } -mframe_t chick_frames_death2 [] = { +static const mframe_t chick_frames_death2 [] = { { ai_move, -6, NULL }, { ai_move, 0, NULL }, { ai_move, -1, NULL }, @@ -315,9 +315,9 @@ mframe_t chick_frames_death2 [] = { { ai_move, 14, NULL }, { ai_move, 1, NULL } }; -mmove_t chick_move_death2 = {FRAME_death201, FRAME_death223, chick_frames_death2, chick_dead}; +const mmove_t chick_move_death2 = {FRAME_death201, FRAME_death223, chick_frames_death2, chick_dead}; -mframe_t chick_frames_death1 [] = { +static const mframe_t chick_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, -7, NULL }, @@ -332,7 +332,7 @@ mframe_t chick_frames_death1 [] = { { ai_move, 0, NULL } }; -mmove_t chick_move_death1 = {FRAME_death101, FRAME_death112, chick_frames_death1, chick_dead}; +const mmove_t chick_move_death1 = {FRAME_death101, FRAME_death112, chick_frames_death1, chick_dead}; void chick_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { @@ -395,7 +395,7 @@ void chick_duck_up(edict_t *self) gi.linkentity(self); } -mframe_t chick_frames_duck [] = { +static const mframe_t chick_frames_duck [] = { { ai_move, 0, chick_duck_down }, { ai_move, 1, NULL }, { ai_move, 4, chick_duck_hold }, @@ -404,7 +404,7 @@ mframe_t chick_frames_duck [] = { { ai_move, 3, NULL }, { ai_move, 1, NULL } }; -mmove_t chick_move_duck = {FRAME_duck01, FRAME_duck07, chick_frames_duck, chick_run}; +const mmove_t chick_move_duck = {FRAME_duck01, FRAME_duck07, chick_frames_duck, chick_run}; void chick_dodge(edict_t *self, edict_t *attacker, float eta) { @@ -456,7 +456,7 @@ void ChickReload(edict_t *self) } -mframe_t chick_frames_start_attack1 [] = { +static const mframe_t chick_frames_start_attack1 [] = { { ai_charge, 0, Chick_PreAttack1 }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -471,10 +471,10 @@ mframe_t chick_frames_start_attack1 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, chick_attack1 } }; -mmove_t chick_move_start_attack1 = {FRAME_attak101, FRAME_attak113, chick_frames_start_attack1, NULL}; +const mmove_t chick_move_start_attack1 = {FRAME_attak101, FRAME_attak113, chick_frames_start_attack1, NULL}; -mframe_t chick_frames_attack1 [] = { +static const mframe_t chick_frames_attack1 [] = { { ai_charge, 19, ChickRocket }, { ai_charge, -6, NULL }, { ai_charge, -5, NULL }, @@ -491,16 +491,16 @@ mframe_t chick_frames_attack1 [] = { { ai_charge, 3, chick_rerocket } }; -mmove_t chick_move_attack1 = {FRAME_attak114, FRAME_attak127, chick_frames_attack1, NULL}; +const mmove_t chick_move_attack1 = {FRAME_attak114, FRAME_attak127, chick_frames_attack1, NULL}; -mframe_t chick_frames_end_attack1 [] = { +static const mframe_t chick_frames_end_attack1 [] = { { ai_charge, -3, NULL }, { ai_charge, 0, NULL }, { ai_charge, -6, NULL }, { ai_charge, -4, NULL }, { ai_charge, -2, NULL } }; -mmove_t chick_move_end_attack1 = {FRAME_attak128, FRAME_attak132, chick_frames_end_attack1, chick_run}; +const mmove_t chick_move_end_attack1 = {FRAME_attak128, FRAME_attak132, chick_frames_end_attack1, chick_run}; void chick_rerocket(edict_t *self) { @@ -520,7 +520,7 @@ void chick_attack1(edict_t *self) self->monsterinfo.currentmove = &chick_move_attack1; } -mframe_t chick_frames_slash [] = { +static const mframe_t chick_frames_slash [] = { { ai_charge, 1, NULL }, { ai_charge, 7, ChickSlash }, { ai_charge, -7, NULL }, @@ -531,15 +531,15 @@ mframe_t chick_frames_slash [] = { { ai_charge, 1, NULL }, { ai_charge, -2, chick_reslash } }; -mmove_t chick_move_slash = {FRAME_attak204, FRAME_attak212, chick_frames_slash, NULL}; +const mmove_t chick_move_slash = {FRAME_attak204, FRAME_attak212, chick_frames_slash, NULL}; -mframe_t chick_frames_end_slash [] = { +static const mframe_t chick_frames_end_slash [] = { { ai_charge, -6, NULL }, { ai_charge, -1, NULL }, { ai_charge, -6, NULL }, { ai_charge, 0, NULL } }; -mmove_t chick_move_end_slash = {FRAME_attak213, FRAME_attak216, chick_frames_end_slash, chick_run}; +const mmove_t chick_move_end_slash = {FRAME_attak213, FRAME_attak216, chick_frames_end_slash, chick_run}; void chick_reslash(edict_t *self) @@ -564,12 +564,12 @@ void chick_slash(edict_t *self) } -mframe_t chick_frames_start_slash [] = { +static const mframe_t chick_frames_start_slash [] = { { ai_charge, 1, NULL }, { ai_charge, 8, NULL }, { ai_charge, 3, NULL } }; -mmove_t chick_move_start_slash = {FRAME_attak201, FRAME_attak203, chick_frames_start_slash, chick_slash}; +const mmove_t chick_move_start_slash = {FRAME_attak201, FRAME_attak203, chick_frames_start_slash, chick_slash}; diff --git a/src/baseq2/m_flipper.c b/src/baseq2/m_flipper.c index 7ea16f940..ec488a431 100644 --- a/src/baseq2/m_flipper.c +++ b/src/baseq2/m_flipper.c @@ -39,11 +39,11 @@ static int sound_sight; void flipper_stand(edict_t *self); -mframe_t flipper_frames_stand [] = { +static const mframe_t flipper_frames_stand [] = { { ai_stand, 0, NULL } }; -mmove_t flipper_move_stand = {FRAME_flphor01, FRAME_flphor01, flipper_frames_stand, NULL}; +const mmove_t flipper_move_stand = {FRAME_flphor01, FRAME_flphor01, flipper_frames_stand, NULL}; void flipper_stand(edict_t *self) { @@ -52,7 +52,7 @@ void flipper_stand(edict_t *self) #define FLIPPER_RUN_SPEED 24 -mframe_t flipper_frames_run [] = { +static const mframe_t flipper_frames_run [] = { { ai_run, FLIPPER_RUN_SPEED, NULL }, // 6 { ai_run, FLIPPER_RUN_SPEED, NULL }, { ai_run, FLIPPER_RUN_SPEED, NULL }, @@ -80,14 +80,14 @@ mframe_t flipper_frames_run [] = { { ai_run, FLIPPER_RUN_SPEED, NULL }, { ai_run, FLIPPER_RUN_SPEED, NULL } // 29 }; -mmove_t flipper_move_run_loop = {FRAME_flpver06, FRAME_flpver29, flipper_frames_run, NULL}; +const mmove_t flipper_move_run_loop = {FRAME_flpver06, FRAME_flpver29, flipper_frames_run, NULL}; void flipper_run_loop(edict_t *self) { self->monsterinfo.currentmove = &flipper_move_run_loop; } -mframe_t flipper_frames_run_start [] = { +static const mframe_t flipper_frames_run_start [] = { { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, NULL }, @@ -95,7 +95,7 @@ mframe_t flipper_frames_run_start [] = { { ai_run, 8, NULL }, { ai_run, 8, NULL } }; -mmove_t flipper_move_run_start = {FRAME_flpver01, FRAME_flpver06, flipper_frames_run_start, flipper_run_loop}; +const mmove_t flipper_move_run_start = {FRAME_flpver01, FRAME_flpver06, flipper_frames_run_start, flipper_run_loop}; void flipper_run(edict_t *self) { @@ -103,7 +103,7 @@ void flipper_run(edict_t *self) } /* Standard Swimming */ -mframe_t flipper_frames_walk [] = { +static const mframe_t flipper_frames_walk [] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -129,44 +129,44 @@ mframe_t flipper_frames_walk [] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL } }; -mmove_t flipper_move_walk = {FRAME_flphor01, FRAME_flphor24, flipper_frames_walk, NULL}; +const mmove_t flipper_move_walk = {FRAME_flphor01, FRAME_flphor24, flipper_frames_walk, NULL}; void flipper_walk(edict_t *self) { self->monsterinfo.currentmove = &flipper_move_walk; } -mframe_t flipper_frames_start_run [] = { +static const mframe_t flipper_frames_start_run [] = { { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, flipper_run } }; -mmove_t flipper_move_start_run = {FRAME_flphor01, FRAME_flphor05, flipper_frames_start_run, NULL}; +const mmove_t flipper_move_start_run = {FRAME_flphor01, FRAME_flphor05, flipper_frames_start_run, NULL}; void flipper_start_run(edict_t *self) { self->monsterinfo.currentmove = &flipper_move_start_run; } -mframe_t flipper_frames_pain2 [] = { +static const mframe_t flipper_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flipper_move_pain2 = {FRAME_flppn101, FRAME_flppn105, flipper_frames_pain2, flipper_run}; +const mmove_t flipper_move_pain2 = {FRAME_flppn101, FRAME_flppn105, flipper_frames_pain2, flipper_run}; -mframe_t flipper_frames_pain1 [] = { +static const mframe_t flipper_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flipper_move_pain1 = {FRAME_flppn201, FRAME_flppn205, flipper_frames_pain1, flipper_run}; +const mmove_t flipper_move_pain1 = {FRAME_flppn201, FRAME_flppn205, flipper_frames_pain1, flipper_run}; void flipper_bite(edict_t *self) { @@ -181,7 +181,7 @@ void flipper_preattack(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_chomp, 1, ATTN_NORM, 0); } -mframe_t flipper_frames_attack [] = { +static const mframe_t flipper_frames_attack [] = { { ai_charge, 0, flipper_preattack }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -203,7 +203,7 @@ mframe_t flipper_frames_attack [] = { { ai_charge, 0, flipper_bite }, { ai_charge, 0, NULL } }; -mmove_t flipper_move_attack = {FRAME_flpbit01, FRAME_flpbit20, flipper_frames_attack, flipper_run}; +const mmove_t flipper_move_attack = {FRAME_flpbit01, FRAME_flpbit20, flipper_frames_attack, flipper_run}; void flipper_melee(edict_t *self) { @@ -245,7 +245,7 @@ void flipper_dead(edict_t *self) gi.linkentity(self); } -mframe_t flipper_frames_death [] = { +static const mframe_t flipper_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -308,7 +308,7 @@ mframe_t flipper_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flipper_move_death = {FRAME_flpdth01, FRAME_flpdth56, flipper_frames_death, flipper_dead}; +const mmove_t flipper_move_death = {FRAME_flpdth01, FRAME_flpdth56, flipper_frames_death, flipper_dead}; void flipper_sight(edict_t *self, edict_t *other) { diff --git a/src/baseq2/m_float.c b/src/baseq2/m_float.c index d8ef4d3b7..9daad097e 100644 --- a/src/baseq2/m_float.c +++ b/src/baseq2/m_float.c @@ -78,7 +78,7 @@ void floater_fire_blaster(edict_t *self) } -mframe_t floater_frames_stand1 [] = { +static const mframe_t floater_frames_stand1 [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -132,9 +132,9 @@ mframe_t floater_frames_stand1 [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t floater_move_stand1 = {FRAME_stand101, FRAME_stand152, floater_frames_stand1, NULL}; +const mmove_t floater_move_stand1 = {FRAME_stand101, FRAME_stand152, floater_frames_stand1, NULL}; -mframe_t floater_frames_stand2 [] = { +static const mframe_t floater_frames_stand2 [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -188,7 +188,7 @@ mframe_t floater_frames_stand2 [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t floater_move_stand2 = {FRAME_stand201, FRAME_stand252, floater_frames_stand2, NULL}; +const mmove_t floater_move_stand2 = {FRAME_stand201, FRAME_stand252, floater_frames_stand2, NULL}; void floater_stand(edict_t *self) { @@ -198,7 +198,7 @@ void floater_stand(edict_t *self) self->monsterinfo.currentmove = &floater_move_stand2; } -mframe_t floater_frames_activate [] = { +static const mframe_t floater_frames_activate [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -230,9 +230,9 @@ mframe_t floater_frames_activate [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t floater_move_activate = {FRAME_actvat01, FRAME_actvat31, floater_frames_activate, NULL}; +const mmove_t floater_move_activate = {FRAME_actvat01, FRAME_actvat31, floater_frames_activate, NULL}; -mframe_t floater_frames_attack1 [] = { +static const mframe_t floater_frames_attack1 [] = { { ai_charge, 0, NULL }, // Blaster attack { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -248,9 +248,9 @@ mframe_t floater_frames_attack1 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } // -- LOOP Ends }; -mmove_t floater_move_attack1 = {FRAME_attak101, FRAME_attak114, floater_frames_attack1, floater_run}; +const mmove_t floater_move_attack1 = {FRAME_attak101, FRAME_attak114, floater_frames_attack1, floater_run}; -mframe_t floater_frames_attack2 [] = { +static const mframe_t floater_frames_attack2 [] = { { ai_charge, 0, NULL }, // Claws { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -277,9 +277,9 @@ mframe_t floater_frames_attack2 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t floater_move_attack2 = {FRAME_attak201, FRAME_attak225, floater_frames_attack2, floater_run}; +const mmove_t floater_move_attack2 = {FRAME_attak201, FRAME_attak225, floater_frames_attack2, floater_run}; -mframe_t floater_frames_attack3 [] = { +static const mframe_t floater_frames_attack3 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -315,9 +315,9 @@ mframe_t floater_frames_attack3 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t floater_move_attack3 = {FRAME_attak301, FRAME_attak334, floater_frames_attack3, floater_run}; +const mmove_t floater_move_attack3 = {FRAME_attak301, FRAME_attak334, floater_frames_attack3, floater_run}; -mframe_t floater_frames_death [] = { +static const mframe_t floater_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -332,9 +332,9 @@ mframe_t floater_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t floater_move_death = {FRAME_death01, FRAME_death13, floater_frames_death, floater_dead}; +const mmove_t floater_move_death = {FRAME_death01, FRAME_death13, floater_frames_death, floater_dead}; -mframe_t floater_frames_pain1 [] = { +static const mframe_t floater_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -343,9 +343,9 @@ mframe_t floater_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t floater_move_pain1 = {FRAME_pain101, FRAME_pain107, floater_frames_pain1, floater_run}; +const mmove_t floater_move_pain1 = {FRAME_pain101, FRAME_pain107, floater_frames_pain1, floater_run}; -mframe_t floater_frames_pain2 [] = { +static const mframe_t floater_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -355,9 +355,9 @@ mframe_t floater_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t floater_move_pain2 = {FRAME_pain201, FRAME_pain208, floater_frames_pain2, floater_run}; +const mmove_t floater_move_pain2 = {FRAME_pain201, FRAME_pain208, floater_frames_pain2, floater_run}; -mframe_t floater_frames_pain3 [] = { +static const mframe_t floater_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -371,9 +371,9 @@ mframe_t floater_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t floater_move_pain3 = {FRAME_pain301, FRAME_pain312, floater_frames_pain3, floater_run}; +const mmove_t floater_move_pain3 = {FRAME_pain301, FRAME_pain312, floater_frames_pain3, floater_run}; -mframe_t floater_frames_walk [] = { +static const mframe_t floater_frames_walk [] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, @@ -427,9 +427,9 @@ mframe_t floater_frames_walk [] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL } }; -mmove_t floater_move_walk = {FRAME_stand101, FRAME_stand152, floater_frames_walk, NULL}; +const mmove_t floater_move_walk = {FRAME_stand101, FRAME_stand152, floater_frames_walk, NULL}; -mframe_t floater_frames_run [] = { +static const mframe_t floater_frames_run [] = { { ai_run, 13, NULL }, { ai_run, 13, NULL }, { ai_run, 13, NULL }, @@ -483,7 +483,7 @@ mframe_t floater_frames_run [] = { { ai_run, 13, NULL }, { ai_run, 13, NULL } }; -mmove_t floater_move_run = {FRAME_stand101, FRAME_stand152, floater_frames_run, NULL}; +const mmove_t floater_move_run = {FRAME_stand101, FRAME_stand152, floater_frames_run, NULL}; void floater_run(edict_t *self) { diff --git a/src/baseq2/m_flyer.c b/src/baseq2/m_flyer.c index eb127e729..dab5a29e3 100644 --- a/src/baseq2/m_flyer.c +++ b/src/baseq2/m_flyer.c @@ -63,7 +63,7 @@ void flyer_pop_blades(edict_t *self) } -mframe_t flyer_frames_stand [] = { +static const mframe_t flyer_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -110,10 +110,10 @@ mframe_t flyer_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t flyer_move_stand = {FRAME_stand01, FRAME_stand45, flyer_frames_stand, NULL}; +const mmove_t flyer_move_stand = {FRAME_stand01, FRAME_stand45, flyer_frames_stand, NULL}; -mframe_t flyer_frames_walk [] = { +static const mframe_t flyer_frames_walk [] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, @@ -160,9 +160,9 @@ mframe_t flyer_frames_walk [] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL } }; -mmove_t flyer_move_walk = {FRAME_stand01, FRAME_stand45, flyer_frames_walk, NULL}; +const mmove_t flyer_move_walk = {FRAME_stand01, FRAME_stand45, flyer_frames_walk, NULL}; -mframe_t flyer_frames_run [] = { +static const mframe_t flyer_frames_run [] = { { ai_run, 10, NULL }, { ai_run, 10, NULL }, { ai_run, 10, NULL }, @@ -209,7 +209,7 @@ mframe_t flyer_frames_run [] = { { ai_run, 10, NULL }, { ai_run, 10, NULL } }; -mmove_t flyer_move_run = {FRAME_stand01, FRAME_stand45, flyer_frames_run, NULL}; +const mmove_t flyer_move_run = {FRAME_stand01, FRAME_stand45, flyer_frames_run, NULL}; void flyer_run(edict_t *self) { @@ -229,7 +229,7 @@ void flyer_stand(edict_t *self) self->monsterinfo.currentmove = &flyer_move_stand; } -mframe_t flyer_frames_start [] = { +static const mframe_t flyer_frames_start [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -237,9 +237,9 @@ mframe_t flyer_frames_start [] = { { ai_move, 0, NULL }, { ai_move, 0, flyer_nextmove } }; -mmove_t flyer_move_start = {FRAME_start01, FRAME_start06, flyer_frames_start, NULL}; +const mmove_t flyer_move_start = {FRAME_start01, FRAME_start06, flyer_frames_start, NULL}; -mframe_t flyer_frames_stop [] = { +static const mframe_t flyer_frames_stop [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -248,7 +248,7 @@ mframe_t flyer_frames_stop [] = { { ai_move, 0, NULL }, { ai_move, 0, flyer_nextmove } }; -mmove_t flyer_move_stop = {FRAME_stop01, FRAME_stop07, flyer_frames_stop, NULL}; +const mmove_t flyer_move_stop = {FRAME_stop01, FRAME_stop07, flyer_frames_stop, NULL}; void flyer_stop(edict_t *self) { @@ -261,7 +261,7 @@ void flyer_start(edict_t *self) } -mframe_t flyer_frames_rollright [] = { +static const mframe_t flyer_frames_rollright [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -272,9 +272,9 @@ mframe_t flyer_frames_rollright [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_rollright = {FRAME_rollr01, FRAME_rollr09, flyer_frames_rollright, NULL}; +const mmove_t flyer_move_rollright = {FRAME_rollr01, FRAME_rollr09, flyer_frames_rollright, NULL}; -mframe_t flyer_frames_rollleft [] = { +static const mframe_t flyer_frames_rollleft [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -285,25 +285,25 @@ mframe_t flyer_frames_rollleft [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_rollleft = {FRAME_rollf01, FRAME_rollf09, flyer_frames_rollleft, NULL}; +const mmove_t flyer_move_rollleft = {FRAME_rollf01, FRAME_rollf09, flyer_frames_rollleft, NULL}; -mframe_t flyer_frames_pain3 [] = { +static const mframe_t flyer_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_pain3 = {FRAME_pain301, FRAME_pain304, flyer_frames_pain3, flyer_run}; +const mmove_t flyer_move_pain3 = {FRAME_pain301, FRAME_pain304, flyer_frames_pain3, flyer_run}; -mframe_t flyer_frames_pain2 [] = { +static const mframe_t flyer_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_pain2 = {FRAME_pain201, FRAME_pain204, flyer_frames_pain2, flyer_run}; +const mmove_t flyer_move_pain2 = {FRAME_pain201, FRAME_pain204, flyer_frames_pain2, flyer_run}; -mframe_t flyer_frames_pain1 [] = { +static const mframe_t flyer_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -314,9 +314,9 @@ mframe_t flyer_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_pain1 = {FRAME_pain101, FRAME_pain109, flyer_frames_pain1, flyer_run}; +const mmove_t flyer_move_pain1 = {FRAME_pain101, FRAME_pain109, flyer_frames_pain1, flyer_run}; -mframe_t flyer_frames_defense [] = { +static const mframe_t flyer_frames_defense [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, // Hold this frame @@ -324,9 +324,9 @@ mframe_t flyer_frames_defense [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_defense = {FRAME_defens01, FRAME_defens06, flyer_frames_defense, NULL}; +const mmove_t flyer_move_defense = {FRAME_defens01, FRAME_defens06, flyer_frames_defense, NULL}; -mframe_t flyer_frames_bankright [] = { +static const mframe_t flyer_frames_bankright [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -335,9 +335,9 @@ mframe_t flyer_frames_bankright [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_bankright = {FRAME_bankr01, FRAME_bankr07, flyer_frames_bankright, NULL}; +const mmove_t flyer_move_bankright = {FRAME_bankr01, FRAME_bankr07, flyer_frames_bankright, NULL}; -mframe_t flyer_frames_bankleft [] = { +static const mframe_t flyer_frames_bankleft [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -346,7 +346,7 @@ mframe_t flyer_frames_bankleft [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t flyer_move_bankleft = {FRAME_bankl01, FRAME_bankl07, flyer_frames_bankleft, NULL}; +const mmove_t flyer_move_bankleft = {FRAME_bankl01, FRAME_bankl07, flyer_frames_bankleft, NULL}; void flyer_fire(edict_t *self, int flash_number) @@ -382,7 +382,7 @@ void flyer_fireright(edict_t *self) } -mframe_t flyer_frames_attack2 [] = { +static const mframe_t flyer_frames_attack2 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -401,7 +401,7 @@ mframe_t flyer_frames_attack2 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t flyer_move_attack2 = {FRAME_attak201, FRAME_attak217, flyer_frames_attack2, flyer_run}; +const mmove_t flyer_move_attack2 = {FRAME_attak201, FRAME_attak217, flyer_frames_attack2, flyer_run}; void flyer_slash_left(edict_t *self) @@ -422,7 +422,7 @@ void flyer_slash_right(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_slash, 1, ATTN_NORM, 0); } -mframe_t flyer_frames_start_melee [] = { +static const mframe_t flyer_frames_start_melee [] = { { ai_charge, 0, flyer_pop_blades }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -430,17 +430,17 @@ mframe_t flyer_frames_start_melee [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t flyer_move_start_melee = {FRAME_attak101, FRAME_attak106, flyer_frames_start_melee, flyer_loop_melee}; +const mmove_t flyer_move_start_melee = {FRAME_attak101, FRAME_attak106, flyer_frames_start_melee, flyer_loop_melee}; -mframe_t flyer_frames_end_melee [] = { +static const mframe_t flyer_frames_end_melee [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t flyer_move_end_melee = {FRAME_attak119, FRAME_attak121, flyer_frames_end_melee, flyer_run}; +const mmove_t flyer_move_end_melee = {FRAME_attak119, FRAME_attak121, flyer_frames_end_melee, flyer_run}; -mframe_t flyer_frames_loop_melee [] = { +static const mframe_t flyer_frames_loop_melee [] = { { ai_charge, 0, NULL }, // Loop Start { ai_charge, 0, NULL }, { ai_charge, 0, flyer_slash_left }, // Left Wing Strike @@ -455,7 +455,7 @@ mframe_t flyer_frames_loop_melee [] = { { ai_charge, 0, NULL } // Loop Ends }; -mmove_t flyer_move_loop_melee = {FRAME_attak107, FRAME_attak118, flyer_frames_loop_melee, flyer_check_melee}; +const mmove_t flyer_move_loop_melee = {FRAME_attak107, FRAME_attak118, flyer_frames_loop_melee, flyer_check_melee}; void flyer_loop_melee(edict_t *self) { diff --git a/src/baseq2/m_gladiator.c b/src/baseq2/m_gladiator.c index 4bae3aa06..815866157 100644 --- a/src/baseq2/m_gladiator.c +++ b/src/baseq2/m_gladiator.c @@ -59,7 +59,7 @@ void gladiator_cleaver_swing(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0); } -mframe_t gladiator_frames_stand [] = { +static const mframe_t gladiator_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -68,7 +68,7 @@ mframe_t gladiator_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t gladiator_move_stand = {FRAME_stand1, FRAME_stand7, gladiator_frames_stand, NULL}; +const mmove_t gladiator_move_stand = {FRAME_stand1, FRAME_stand7, gladiator_frames_stand, NULL}; void gladiator_stand(edict_t *self) { @@ -76,7 +76,7 @@ void gladiator_stand(edict_t *self) } -mframe_t gladiator_frames_walk [] = { +static const mframe_t gladiator_frames_walk [] = { { ai_walk, 15, NULL }, { ai_walk, 7, NULL }, { ai_walk, 6, NULL }, @@ -94,7 +94,7 @@ mframe_t gladiator_frames_walk [] = { { ai_walk, 1, NULL }, { ai_walk, 8, NULL } }; -mmove_t gladiator_move_walk = {FRAME_walk1, FRAME_walk16, gladiator_frames_walk, NULL}; +const mmove_t gladiator_move_walk = {FRAME_walk1, FRAME_walk16, gladiator_frames_walk, NULL}; void gladiator_walk(edict_t *self) { @@ -102,7 +102,7 @@ void gladiator_walk(edict_t *self) } -mframe_t gladiator_frames_run [] = { +static const mframe_t gladiator_frames_run [] = { { ai_run, 23, NULL }, { ai_run, 14, NULL }, { ai_run, 14, NULL }, @@ -110,7 +110,7 @@ mframe_t gladiator_frames_run [] = { { ai_run, 12, NULL }, { ai_run, 13, NULL } }; -mmove_t gladiator_move_run = {FRAME_run1, FRAME_run6, gladiator_frames_run, NULL}; +const mmove_t gladiator_move_run = {FRAME_run1, FRAME_run6, gladiator_frames_run, NULL}; void gladiator_run(edict_t *self) { @@ -132,7 +132,7 @@ void GaldiatorMelee(edict_t *self) gi.sound(self, CHAN_AUTO, sound_cleaver_miss, 1, ATTN_NORM, 0); } -mframe_t gladiator_frames_attack_melee [] = { +static const mframe_t gladiator_frames_attack_melee [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -151,7 +151,7 @@ mframe_t gladiator_frames_attack_melee [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t gladiator_move_attack_melee = {FRAME_melee1, FRAME_melee17, gladiator_frames_attack_melee, gladiator_run}; +const mmove_t gladiator_move_attack_melee = {FRAME_melee1, FRAME_melee17, gladiator_frames_attack_melee, gladiator_run}; void gladiator_melee(edict_t *self) { @@ -175,7 +175,7 @@ void GladiatorGun(edict_t *self) monster_fire_railgun(self, start, dir, 50, 100, MZ2_GLADIATOR_RAILGUN_1); } -mframe_t gladiator_frames_attack_gun [] = { +static const mframe_t gladiator_frames_attack_gun [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -186,7 +186,7 @@ mframe_t gladiator_frames_attack_gun [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t gladiator_move_attack_gun = {FRAME_attack1, FRAME_attack9, gladiator_frames_attack_gun, gladiator_run}; +const mmove_t gladiator_move_attack_gun = {FRAME_attack1, FRAME_attack9, gladiator_frames_attack_gun, gladiator_run}; void gladiator_attack(edict_t *self) { @@ -207,7 +207,7 @@ void gladiator_attack(edict_t *self) } -mframe_t gladiator_frames_pain [] = { +static const mframe_t gladiator_frames_pain [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -215,9 +215,9 @@ mframe_t gladiator_frames_pain [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t gladiator_move_pain = {FRAME_pain1, FRAME_pain6, gladiator_frames_pain, gladiator_run}; +const mmove_t gladiator_move_pain = {FRAME_pain1, FRAME_pain6, gladiator_frames_pain, gladiator_run}; -mframe_t gladiator_frames_pain_air [] = { +static const mframe_t gladiator_frames_pain_air [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -226,7 +226,7 @@ mframe_t gladiator_frames_pain_air [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t gladiator_move_pain_air = {FRAME_painup1, FRAME_painup7, gladiator_frames_pain_air, gladiator_run}; +const mmove_t gladiator_move_pain_air = {FRAME_painup1, FRAME_painup7, gladiator_frames_pain_air, gladiator_run}; void gladiator_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -268,7 +268,7 @@ void gladiator_dead(edict_t *self) gi.linkentity(self); } -mframe_t gladiator_frames_death [] = { +static const mframe_t gladiator_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -292,7 +292,7 @@ mframe_t gladiator_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t gladiator_move_death = {FRAME_death1, FRAME_death22, gladiator_frames_death, gladiator_dead}; +const mmove_t gladiator_move_death = {FRAME_death1, FRAME_death22, gladiator_frames_death, gladiator_dead}; void gladiator_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { diff --git a/src/baseq2/m_gunner.c b/src/baseq2/m_gunner.c index 6504e8a82..01784f188 100644 --- a/src/baseq2/m_gunner.c +++ b/src/baseq2/m_gunner.c @@ -61,7 +61,7 @@ void gunner_refire_chain(edict_t *self); void gunner_stand(edict_t *self); -mframe_t gunner_frames_fidget [] = { +static const mframe_t gunner_frames_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -116,7 +116,7 @@ mframe_t gunner_frames_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t gunner_move_fidget = {FRAME_stand31, FRAME_stand70, gunner_frames_fidget, gunner_stand}; +const mmove_t gunner_move_fidget = {FRAME_stand31, FRAME_stand70, gunner_frames_fidget, gunner_stand}; void gunner_fidget(edict_t *self) { @@ -126,7 +126,7 @@ void gunner_fidget(edict_t *self) self->monsterinfo.currentmove = &gunner_move_fidget; } -mframe_t gunner_frames_stand [] = { +static const mframe_t gunner_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -160,7 +160,7 @@ mframe_t gunner_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, gunner_fidget } }; -mmove_t gunner_move_stand = {FRAME_stand01, FRAME_stand30, gunner_frames_stand, NULL}; +const mmove_t gunner_move_stand = {FRAME_stand01, FRAME_stand30, gunner_frames_stand, NULL}; void gunner_stand(edict_t *self) { @@ -168,7 +168,7 @@ void gunner_stand(edict_t *self) } -mframe_t gunner_frames_walk [] = { +static const mframe_t gunner_frames_walk [] = { { ai_walk, 0, NULL }, { ai_walk, 3, NULL }, { ai_walk, 4, NULL }, @@ -183,14 +183,14 @@ mframe_t gunner_frames_walk [] = { { ai_walk, 7, NULL }, { ai_walk, 4, NULL } }; -mmove_t gunner_move_walk = {FRAME_walk07, FRAME_walk19, gunner_frames_walk, NULL}; +const mmove_t gunner_move_walk = {FRAME_walk07, FRAME_walk19, gunner_frames_walk, NULL}; void gunner_walk(edict_t *self) { self->monsterinfo.currentmove = &gunner_move_walk; } -mframe_t gunner_frames_run [] = { +static const mframe_t gunner_frames_run [] = { { ai_run, 26, NULL }, { ai_run, 9, NULL }, { ai_run, 9, NULL }, @@ -201,7 +201,7 @@ mframe_t gunner_frames_run [] = { { ai_run, 6, NULL } }; -mmove_t gunner_move_run = {FRAME_run01, FRAME_run08, gunner_frames_run, NULL}; +const mmove_t gunner_move_run = {FRAME_run01, FRAME_run08, gunner_frames_run, NULL}; void gunner_run(edict_t *self) { @@ -211,7 +211,7 @@ void gunner_run(edict_t *self) self->monsterinfo.currentmove = &gunner_move_run; } -mframe_t gunner_frames_runandshoot [] = { +static const mframe_t gunner_frames_runandshoot [] = { { ai_run, 32, NULL }, { ai_run, 15, NULL }, { ai_run, 10, NULL }, @@ -220,23 +220,23 @@ mframe_t gunner_frames_runandshoot [] = { { ai_run, 20, NULL } }; -mmove_t gunner_move_runandshoot = {FRAME_runs01, FRAME_runs06, gunner_frames_runandshoot, NULL}; +const mmove_t gunner_move_runandshoot = {FRAME_runs01, FRAME_runs06, gunner_frames_runandshoot, NULL}; void gunner_runandshoot(edict_t *self) { self->monsterinfo.currentmove = &gunner_move_runandshoot; } -mframe_t gunner_frames_pain3 [] = { +static const mframe_t gunner_frames_pain3 [] = { { ai_move, -3, NULL }, { ai_move, 1, NULL }, { ai_move, 1, NULL }, { ai_move, 0, NULL }, { ai_move, 1, NULL } }; -mmove_t gunner_move_pain3 = {FRAME_pain301, FRAME_pain305, gunner_frames_pain3, gunner_run}; +const mmove_t gunner_move_pain3 = {FRAME_pain301, FRAME_pain305, gunner_frames_pain3, gunner_run}; -mframe_t gunner_frames_pain2 [] = { +static const mframe_t gunner_frames_pain2 [] = { { ai_move, -2, NULL }, { ai_move, 11, NULL }, { ai_move, 6, NULL }, @@ -246,9 +246,9 @@ mframe_t gunner_frames_pain2 [] = { { ai_move, -2, NULL }, { ai_move, -7, NULL } }; -mmove_t gunner_move_pain2 = {FRAME_pain201, FRAME_pain208, gunner_frames_pain2, gunner_run}; +const mmove_t gunner_move_pain2 = {FRAME_pain201, FRAME_pain208, gunner_frames_pain2, gunner_run}; -mframe_t gunner_frames_pain1 [] = { +static const mframe_t gunner_frames_pain1 [] = { { ai_move, 2, NULL }, { ai_move, 0, NULL }, { ai_move, -5, NULL }, @@ -268,7 +268,7 @@ mframe_t gunner_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t gunner_move_pain1 = {FRAME_pain101, FRAME_pain118, gunner_frames_pain1, gunner_run}; +const mmove_t gunner_move_pain1 = {FRAME_pain101, FRAME_pain118, gunner_frames_pain1, gunner_run}; void gunner_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -306,7 +306,7 @@ void gunner_dead(edict_t *self) gi.linkentity(self); } -mframe_t gunner_frames_death [] = { +static const mframe_t gunner_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -319,7 +319,7 @@ mframe_t gunner_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t gunner_move_death = {FRAME_death01, FRAME_death11, gunner_frames_death, gunner_dead}; +const mmove_t gunner_move_death = {FRAME_death01, FRAME_death11, gunner_frames_death, gunner_dead}; void gunner_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { @@ -380,7 +380,7 @@ void gunner_duck_up(edict_t *self) gi.linkentity(self); } -mframe_t gunner_frames_duck [] = { +static const mframe_t gunner_frames_duck [] = { { ai_move, 1, gunner_duck_down }, { ai_move, 1, NULL }, { ai_move, 1, gunner_duck_hold }, @@ -390,7 +390,7 @@ mframe_t gunner_frames_duck [] = { { ai_move, 0, gunner_duck_up }, { ai_move, -1, NULL } }; -mmove_t gunner_move_duck = {FRAME_duck01, FRAME_duck08, gunner_frames_duck, gunner_run}; +const mmove_t gunner_move_duck = {FRAME_duck01, FRAME_duck08, gunner_frames_duck, gunner_run}; void gunner_dodge(edict_t *self, edict_t *attacker, float eta) { @@ -457,7 +457,7 @@ void GunnerGrenade(edict_t *self) monster_fire_grenade(self, start, aim, 50, 600, flash_number); } -mframe_t gunner_frames_attack_chain [] = { +static const mframe_t gunner_frames_attack_chain [] = { { ai_charge, 0, gunner_opengun }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -466,9 +466,9 @@ mframe_t gunner_frames_attack_chain [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t gunner_move_attack_chain = {FRAME_attak209, FRAME_attak215, gunner_frames_attack_chain, gunner_fire_chain}; +const mmove_t gunner_move_attack_chain = {FRAME_attak209, FRAME_attak215, gunner_frames_attack_chain, gunner_fire_chain}; -mframe_t gunner_frames_fire_chain [] = { +static const mframe_t gunner_frames_fire_chain [] = { { ai_charge, 0, GunnerFire }, { ai_charge, 0, GunnerFire }, { ai_charge, 0, GunnerFire }, @@ -478,9 +478,9 @@ mframe_t gunner_frames_fire_chain [] = { { ai_charge, 0, GunnerFire }, { ai_charge, 0, GunnerFire } }; -mmove_t gunner_move_fire_chain = {FRAME_attak216, FRAME_attak223, gunner_frames_fire_chain, gunner_refire_chain}; +const mmove_t gunner_move_fire_chain = {FRAME_attak216, FRAME_attak223, gunner_frames_fire_chain, gunner_refire_chain}; -mframe_t gunner_frames_endfire_chain [] = { +static const mframe_t gunner_frames_endfire_chain [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -489,9 +489,9 @@ mframe_t gunner_frames_endfire_chain [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t gunner_move_endfire_chain = {FRAME_attak224, FRAME_attak230, gunner_frames_endfire_chain, gunner_run}; +const mmove_t gunner_move_endfire_chain = {FRAME_attak224, FRAME_attak230, gunner_frames_endfire_chain, gunner_run}; -mframe_t gunner_frames_attack_grenade [] = { +static const mframe_t gunner_frames_attack_grenade [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -514,7 +514,7 @@ mframe_t gunner_frames_attack_grenade [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t gunner_move_attack_grenade = {FRAME_attak101, FRAME_attak121, gunner_frames_attack_grenade, gunner_run}; +const mmove_t gunner_move_attack_grenade = {FRAME_attak101, FRAME_attak121, gunner_frames_attack_grenade, gunner_run}; void gunner_attack(edict_t *self) { diff --git a/src/baseq2/m_hover.c b/src/baseq2/m_hover.c index 48980ffda..78f944de1 100644 --- a/src/baseq2/m_hover.c +++ b/src/baseq2/m_hover.c @@ -60,7 +60,7 @@ void hover_reattack(edict_t *self); void hover_fire_blaster(edict_t *self); void hover_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point); -mframe_t hover_frames_stand [] = { +static const mframe_t hover_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -92,9 +92,9 @@ mframe_t hover_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t hover_move_stand = {FRAME_stand01, FRAME_stand30, hover_frames_stand, NULL}; +const mmove_t hover_move_stand = {FRAME_stand01, FRAME_stand30, hover_frames_stand, NULL}; -mframe_t hover_frames_stop1 [] = { +static const mframe_t hover_frames_stop1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -105,9 +105,9 @@ mframe_t hover_frames_stop1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t hover_move_stop1 = {FRAME_stop101, FRAME_stop109, hover_frames_stop1, NULL}; +const mmove_t hover_move_stop1 = {FRAME_stop101, FRAME_stop109, hover_frames_stop1, NULL}; -mframe_t hover_frames_stop2 [] = { +static const mframe_t hover_frames_stop2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -117,9 +117,9 @@ mframe_t hover_frames_stop2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t hover_move_stop2 = {FRAME_stop201, FRAME_stop208, hover_frames_stop2, NULL}; +const mmove_t hover_move_stop2 = {FRAME_stop201, FRAME_stop208, hover_frames_stop2, NULL}; -mframe_t hover_frames_takeoff [] = { +static const mframe_t hover_frames_takeoff [] = { { ai_move, 0, NULL }, { ai_move, -2, NULL }, { ai_move, 5, NULL }, @@ -151,9 +151,9 @@ mframe_t hover_frames_takeoff [] = { { ai_move, 2, NULL }, { ai_move, 0, NULL } }; -mmove_t hover_move_takeoff = {FRAME_takeof01, FRAME_takeof30, hover_frames_takeoff, NULL}; +const mmove_t hover_move_takeoff = {FRAME_takeof01, FRAME_takeof30, hover_frames_takeoff, NULL}; -mframe_t hover_frames_pain3 [] = { +static const mframe_t hover_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -164,9 +164,9 @@ mframe_t hover_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t hover_move_pain3 = {FRAME_pain301, FRAME_pain309, hover_frames_pain3, hover_run}; +const mmove_t hover_move_pain3 = {FRAME_pain301, FRAME_pain309, hover_frames_pain3, hover_run}; -mframe_t hover_frames_pain2 [] = { +static const mframe_t hover_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -180,9 +180,9 @@ mframe_t hover_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t hover_move_pain2 = {FRAME_pain201, FRAME_pain212, hover_frames_pain2, hover_run}; +const mmove_t hover_move_pain2 = {FRAME_pain201, FRAME_pain212, hover_frames_pain2, hover_run}; -mframe_t hover_frames_pain1 [] = { +static const mframe_t hover_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 2, NULL }, @@ -212,14 +212,14 @@ mframe_t hover_frames_pain1 [] = { { ai_move, 3, NULL }, { ai_move, 4, NULL } }; -mmove_t hover_move_pain1 = {FRAME_pain101, FRAME_pain128, hover_frames_pain1, hover_run}; +const mmove_t hover_move_pain1 = {FRAME_pain101, FRAME_pain128, hover_frames_pain1, hover_run}; -mframe_t hover_frames_land [] = { +static const mframe_t hover_frames_land [] = { { ai_move, 0, NULL } }; -mmove_t hover_move_land = {FRAME_land01, FRAME_land01, hover_frames_land, NULL}; +const mmove_t hover_move_land = {FRAME_land01, FRAME_land01, hover_frames_land, NULL}; -mframe_t hover_frames_forward [] = { +static const mframe_t hover_frames_forward [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -256,9 +256,9 @@ mframe_t hover_frames_forward [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t hover_move_forward = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_forward, NULL}; +const mmove_t hover_move_forward = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_forward, NULL}; -mframe_t hover_frames_walk [] = { +static const mframe_t hover_frames_walk [] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -295,9 +295,9 @@ mframe_t hover_frames_walk [] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL } }; -mmove_t hover_move_walk = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_walk, NULL}; +const mmove_t hover_move_walk = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_walk, NULL}; -mframe_t hover_frames_run [] = { +static const mframe_t hover_frames_run [] = { { ai_run, 10, NULL }, { ai_run, 10, NULL }, { ai_run, 10, NULL }, @@ -334,9 +334,9 @@ mframe_t hover_frames_run [] = { { ai_run, 10, NULL }, { ai_run, 10, NULL } }; -mmove_t hover_move_run = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_run, NULL}; +const mmove_t hover_move_run = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_run, NULL}; -mframe_t hover_frames_death1 [] = { +static const mframe_t hover_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -349,9 +349,9 @@ mframe_t hover_frames_death1 [] = { { ai_move, 4, NULL }, { ai_move, 7, NULL } }; -mmove_t hover_move_death1 = {FRAME_death101, FRAME_death111, hover_frames_death1, hover_dead}; +const mmove_t hover_move_death1 = {FRAME_death101, FRAME_death111, hover_frames_death1, hover_dead}; -mframe_t hover_frames_backward [] = { +static const mframe_t hover_frames_backward [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -377,28 +377,28 @@ mframe_t hover_frames_backward [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t hover_move_backward = {FRAME_backwd01, FRAME_backwd24, hover_frames_backward, NULL}; +const mmove_t hover_move_backward = {FRAME_backwd01, FRAME_backwd24, hover_frames_backward, NULL}; -mframe_t hover_frames_start_attack [] = { +static const mframe_t hover_frames_start_attack [] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL } }; -mmove_t hover_move_start_attack = {FRAME_attak101, FRAME_attak103, hover_frames_start_attack, hover_attack}; +const mmove_t hover_move_start_attack = {FRAME_attak101, FRAME_attak103, hover_frames_start_attack, hover_attack}; -mframe_t hover_frames_attack1 [] = { +static const mframe_t hover_frames_attack1 [] = { { ai_charge, -10, hover_fire_blaster }, { ai_charge, -10, hover_fire_blaster }, { ai_charge, 0, hover_reattack }, }; -mmove_t hover_move_attack1 = {FRAME_attak104, FRAME_attak106, hover_frames_attack1, NULL}; +const mmove_t hover_move_attack1 = {FRAME_attak104, FRAME_attak106, hover_frames_attack1, NULL}; -mframe_t hover_frames_end_attack [] = { +static const mframe_t hover_frames_end_attack [] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL } }; -mmove_t hover_move_end_attack = {FRAME_attak107, FRAME_attak108, hover_frames_end_attack, hover_run}; +const mmove_t hover_move_end_attack = {FRAME_attak107, FRAME_attak108, hover_frames_end_attack, hover_run}; void hover_reattack(edict_t *self) { diff --git a/src/baseq2/m_infantry.c b/src/baseq2/m_infantry.c index 46f3afd1c..0994a1fb0 100644 --- a/src/baseq2/m_infantry.c +++ b/src/baseq2/m_infantry.c @@ -43,7 +43,7 @@ static int sound_search; static int sound_idle; -mframe_t infantry_frames_stand [] = { +static const mframe_t infantry_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -67,7 +67,7 @@ mframe_t infantry_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t infantry_move_stand = {FRAME_stand50, FRAME_stand71, infantry_frames_stand, NULL}; +const mmove_t infantry_move_stand = {FRAME_stand50, FRAME_stand71, infantry_frames_stand, NULL}; void infantry_stand(edict_t *self) { @@ -75,7 +75,7 @@ void infantry_stand(edict_t *self) } -mframe_t infantry_frames_fidget [] = { +static const mframe_t infantry_frames_fidget [] = { { ai_stand, 1, NULL }, { ai_stand, 0, NULL }, { ai_stand, 1, NULL }, @@ -126,7 +126,7 @@ mframe_t infantry_frames_fidget [] = { { ai_stand, -3, NULL }, { ai_stand, -2, NULL } }; -mmove_t infantry_move_fidget = {FRAME_stand01, FRAME_stand49, infantry_frames_fidget, infantry_stand}; +const mmove_t infantry_move_fidget = {FRAME_stand01, FRAME_stand49, infantry_frames_fidget, infantry_stand}; void infantry_fidget(edict_t *self) { @@ -134,7 +134,7 @@ void infantry_fidget(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0); } -mframe_t infantry_frames_walk [] = { +static const mframe_t infantry_frames_walk [] = { { ai_walk, 5, NULL }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -148,14 +148,14 @@ mframe_t infantry_frames_walk [] = { { ai_walk, 4, NULL }, { ai_walk, 5, NULL } }; -mmove_t infantry_move_walk = {FRAME_walk03, FRAME_walk14, infantry_frames_walk, NULL}; +const mmove_t infantry_move_walk = {FRAME_walk03, FRAME_walk14, infantry_frames_walk, NULL}; void infantry_walk(edict_t *self) { self->monsterinfo.currentmove = &infantry_move_walk; } -mframe_t infantry_frames_run [] = { +static const mframe_t infantry_frames_run [] = { { ai_run, 10, NULL }, { ai_run, 20, NULL }, { ai_run, 5, NULL }, @@ -165,7 +165,7 @@ mframe_t infantry_frames_run [] = { { ai_run, 2, NULL }, { ai_run, 6, NULL } }; -mmove_t infantry_move_run = {FRAME_run01, FRAME_run08, infantry_frames_run, NULL}; +const mmove_t infantry_move_run = {FRAME_run01, FRAME_run08, infantry_frames_run, NULL}; void infantry_run(edict_t *self) { @@ -176,7 +176,7 @@ void infantry_run(edict_t *self) } -mframe_t infantry_frames_pain1 [] = { +static const mframe_t infantry_frames_pain1 [] = { { ai_move, -3, NULL }, { ai_move, -2, NULL }, { ai_move, -1, NULL }, @@ -188,9 +188,9 @@ mframe_t infantry_frames_pain1 [] = { { ai_move, 6, NULL }, { ai_move, 2, NULL } }; -mmove_t infantry_move_pain1 = {FRAME_pain101, FRAME_pain110, infantry_frames_pain1, infantry_run}; +const mmove_t infantry_move_pain1 = {FRAME_pain101, FRAME_pain110, infantry_frames_pain1, infantry_run}; -mframe_t infantry_frames_pain2 [] = { +static const mframe_t infantry_frames_pain2 [] = { { ai_move, -3, NULL }, { ai_move, -3, NULL }, { ai_move, 0, NULL }, @@ -202,7 +202,7 @@ mframe_t infantry_frames_pain2 [] = { { ai_move, 5, NULL }, { ai_move, 2, NULL } }; -mmove_t infantry_move_pain2 = {FRAME_pain201, FRAME_pain210, infantry_frames_pain2, infantry_run}; +const mmove_t infantry_move_pain2 = {FRAME_pain201, FRAME_pain210, infantry_frames_pain2, infantry_run}; void infantry_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -294,7 +294,7 @@ void infantry_dead(edict_t *self) M_FlyCheck(self); } -mframe_t infantry_frames_death1 [] = { +static const mframe_t infantry_frames_death1 [] = { { ai_move, -4, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -316,10 +316,10 @@ mframe_t infantry_frames_death1 [] = { { ai_move, -3, NULL }, { ai_move, -3, NULL } }; -mmove_t infantry_move_death1 = {FRAME_death101, FRAME_death120, infantry_frames_death1, infantry_dead}; +const mmove_t infantry_move_death1 = {FRAME_death101, FRAME_death120, infantry_frames_death1, infantry_dead}; // Off with his head -mframe_t infantry_frames_death2 [] = { +static const mframe_t infantry_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 1, NULL }, { ai_move, 5, NULL }, @@ -346,9 +346,9 @@ mframe_t infantry_frames_death2 [] = { { ai_move, 4, NULL }, { ai_move, 0, NULL } }; -mmove_t infantry_move_death2 = {FRAME_death201, FRAME_death225, infantry_frames_death2, infantry_dead}; +const mmove_t infantry_move_death2 = {FRAME_death201, FRAME_death225, infantry_frames_death2, infantry_dead}; -mframe_t infantry_frames_death3 [] = { +static const mframe_t infantry_frames_death3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -359,7 +359,7 @@ mframe_t infantry_frames_death3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t infantry_move_death3 = {FRAME_death301, FRAME_death309, infantry_frames_death3, infantry_dead}; +const mmove_t infantry_move_death3 = {FRAME_death301, FRAME_death309, infantry_frames_death3, infantry_dead}; void infantry_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) @@ -426,14 +426,14 @@ void infantry_duck_up(edict_t *self) gi.linkentity(self); } -mframe_t infantry_frames_duck [] = { +static const mframe_t infantry_frames_duck [] = { { ai_move, -2, infantry_duck_down }, { ai_move, -5, infantry_duck_hold }, { ai_move, 3, NULL }, { ai_move, 4, infantry_duck_up }, { ai_move, 0, NULL } }; -mmove_t infantry_move_duck = {FRAME_duck01, FRAME_duck05, infantry_frames_duck, infantry_run}; +const mmove_t infantry_move_duck = {FRAME_duck01, FRAME_duck05, infantry_frames_duck, infantry_run}; void infantry_dodge(edict_t *self, edict_t *attacker, float eta) { @@ -466,7 +466,7 @@ void infantry_fire(edict_t *self) self->monsterinfo.aiflags |= AI_HOLD_FRAME; } -mframe_t infantry_frames_attack1 [] = { +static const mframe_t infantry_frames_attack1 [] = { { ai_charge, 4, NULL }, { ai_charge, -1, NULL }, { ai_charge, -1, NULL }, @@ -483,7 +483,7 @@ mframe_t infantry_frames_attack1 [] = { { ai_charge, -2, NULL }, { ai_charge, -3, NULL } }; -mmove_t infantry_move_attack1 = {FRAME_attak101, FRAME_attak115, infantry_frames_attack1, infantry_run}; +const mmove_t infantry_move_attack1 = {FRAME_attak101, FRAME_attak115, infantry_frames_attack1, infantry_run}; void infantry_swing(edict_t *self) @@ -500,7 +500,7 @@ void infantry_smack(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_punch_hit, 1, ATTN_NORM, 0); } -mframe_t infantry_frames_attack2 [] = { +static const mframe_t infantry_frames_attack2 [] = { { ai_charge, 3, NULL }, { ai_charge, 6, NULL }, { ai_charge, 0, infantry_swing }, @@ -510,7 +510,7 @@ mframe_t infantry_frames_attack2 [] = { { ai_charge, 6, NULL }, { ai_charge, 3, NULL }, }; -mmove_t infantry_move_attack2 = {FRAME_attak201, FRAME_attak208, infantry_frames_attack2, infantry_run}; +const mmove_t infantry_move_attack2 = {FRAME_attak201, FRAME_attak208, infantry_frames_attack2, infantry_run}; void infantry_attack(edict_t *self) { diff --git a/src/baseq2/m_insane.c b/src/baseq2/m_insane.c index 0c001ea48..469c8e91b 100644 --- a/src/baseq2/m_insane.c +++ b/src/baseq2/m_insane.c @@ -63,7 +63,7 @@ void insane_checkup(edict_t *self); void insane_onground(edict_t *self); -mframe_t insane_frames_stand_normal [] = { +static const mframe_t insane_frames_stand_normal [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -71,9 +71,9 @@ mframe_t insane_frames_stand_normal [] = { { ai_stand, 0, NULL }, { ai_stand, 0, insane_checkdown } }; -mmove_t insane_move_stand_normal = {FRAME_stand60, FRAME_stand65, insane_frames_stand_normal, insane_stand}; +const mmove_t insane_move_stand_normal = {FRAME_stand60, FRAME_stand65, insane_frames_stand_normal, insane_stand}; -mframe_t insane_frames_stand_insane [] = { +static const mframe_t insane_frames_stand_insane [] = { { ai_stand, 0, insane_shake }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -105,9 +105,9 @@ mframe_t insane_frames_stand_insane [] = { { ai_stand, 0, NULL }, { ai_stand, 0, insane_checkdown } }; -mmove_t insane_move_stand_insane = {FRAME_stand65, FRAME_stand94, insane_frames_stand_insane, insane_stand}; +const mmove_t insane_move_stand_insane = {FRAME_stand65, FRAME_stand94, insane_frames_stand_insane, insane_stand}; -mframe_t insane_frames_uptodown [] = { +static const mframe_t insane_frames_uptodown [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -152,10 +152,10 @@ mframe_t insane_frames_uptodown [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_uptodown = {FRAME_stand1, FRAME_stand40, insane_frames_uptodown, insane_onground}; +const mmove_t insane_move_uptodown = {FRAME_stand1, FRAME_stand40, insane_frames_uptodown, insane_onground}; -mframe_t insane_frames_downtoup [] = { +static const mframe_t insane_frames_downtoup [] = { { ai_move, -0.7, NULL }, // 41 { ai_move, -1.2, NULL }, // 42 { ai_move, -1.5, NULL }, // 43 @@ -176,19 +176,19 @@ mframe_t insane_frames_downtoup [] = { { ai_move, 0, NULL }, // 58 { ai_move, 0, NULL } // 59 }; -mmove_t insane_move_downtoup = {FRAME_stand41, FRAME_stand59, insane_frames_downtoup, insane_stand}; +const mmove_t insane_move_downtoup = {FRAME_stand41, FRAME_stand59, insane_frames_downtoup, insane_stand}; -mframe_t insane_frames_jumpdown [] = { +static const mframe_t insane_frames_jumpdown [] = { { ai_move, 0.2, NULL }, { ai_move, 11.5, NULL }, { ai_move, 5.1, NULL }, { ai_move, 7.1, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_jumpdown = {FRAME_stand96, FRAME_stand100, insane_frames_jumpdown, insane_onground}; +const mmove_t insane_move_jumpdown = {FRAME_stand96, FRAME_stand100, insane_frames_jumpdown, insane_onground}; -mframe_t insane_frames_down [] = { +static const mframe_t insane_frames_down [] = { { ai_move, 0, NULL }, // 100 { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -251,9 +251,9 @@ mframe_t insane_frames_down [] = { { ai_move, 0.7, NULL }, { ai_move, 0, insane_checkup } // 160 }; -mmove_t insane_move_down = {FRAME_stand100, FRAME_stand160, insane_frames_down, insane_onground}; +const mmove_t insane_move_down = {FRAME_stand100, FRAME_stand160, insane_frames_down, insane_onground}; -mframe_t insane_frames_walk_normal [] = { +static const mframe_t insane_frames_walk_normal [] = { { ai_walk, 0, insane_scream }, { ai_walk, 2.5, NULL }, { ai_walk, 3.5, NULL }, @@ -268,10 +268,10 @@ mframe_t insane_frames_walk_normal [] = { { ai_walk, 0.9, NULL }, { ai_walk, 0, NULL } }; -mmove_t insane_move_walk_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_walk}; -mmove_t insane_move_run_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_run}; +const mmove_t insane_move_walk_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_walk}; +const mmove_t insane_move_run_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_run}; -mframe_t insane_frames_walk_insane [] = { +static const mframe_t insane_frames_walk_insane [] = { { ai_walk, 0, insane_scream }, // walk 1 { ai_walk, 3.4, NULL }, // walk 2 { ai_walk, 3.6, NULL }, // 3 @@ -299,10 +299,10 @@ mframe_t insane_frames_walk_insane [] = { { ai_walk, 1.8, NULL }, // 25 { ai_walk, 0, NULL } // 26 }; -mmove_t insane_move_walk_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_walk}; -mmove_t insane_move_run_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_run}; +const mmove_t insane_move_walk_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_walk}; +const mmove_t insane_move_run_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_run}; -mframe_t insane_frames_stand_pain [] = { +static const mframe_t insane_frames_stand_pain [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -315,9 +315,9 @@ mframe_t insane_frames_stand_pain [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_stand_pain = {FRAME_st_pain2, FRAME_st_pain12, insane_frames_stand_pain, insane_run}; +const mmove_t insane_move_stand_pain = {FRAME_st_pain2, FRAME_st_pain12, insane_frames_stand_pain, insane_run}; -mframe_t insane_frames_stand_death [] = { +static const mframe_t insane_frames_stand_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -336,9 +336,9 @@ mframe_t insane_frames_stand_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_stand_death = {FRAME_st_death2, FRAME_st_death18, insane_frames_stand_death, insane_dead}; +const mmove_t insane_move_stand_death = {FRAME_st_death2, FRAME_st_death18, insane_frames_stand_death, insane_dead}; -mframe_t insane_frames_crawl [] = { +static const mframe_t insane_frames_crawl [] = { { ai_walk, 0, insane_scream }, { ai_walk, 1.5, NULL }, { ai_walk, 2.1, NULL }, @@ -349,10 +349,10 @@ mframe_t insane_frames_crawl [] = { { ai_walk, 3.4, NULL }, { ai_walk, 2.4, NULL } }; -mmove_t insane_move_crawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL}; -mmove_t insane_move_runcrawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL}; +const mmove_t insane_move_crawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL}; +const mmove_t insane_move_runcrawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL}; -mframe_t insane_frames_crawl_pain [] = { +static const mframe_t insane_frames_crawl_pain [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -363,9 +363,9 @@ mframe_t insane_frames_crawl_pain [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_crawl_pain = {FRAME_cr_pain2, FRAME_cr_pain10, insane_frames_crawl_pain, insane_run}; +const mmove_t insane_move_crawl_pain = {FRAME_cr_pain2, FRAME_cr_pain10, insane_frames_crawl_pain, insane_run}; -mframe_t insane_frames_crawl_death [] = { +static const mframe_t insane_frames_crawl_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -374,9 +374,9 @@ mframe_t insane_frames_crawl_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_crawl_death = {FRAME_cr_death10, FRAME_cr_death16, insane_frames_crawl_death, insane_dead}; +const mmove_t insane_move_crawl_death = {FRAME_cr_death10, FRAME_cr_death16, insane_frames_crawl_death, insane_dead}; -mframe_t insane_frames_cross [] = { +static const mframe_t insane_frames_cross [] = { { ai_move, 0, insane_moan }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -393,9 +393,9 @@ mframe_t insane_frames_cross [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_cross = {FRAME_cross1, FRAME_cross15, insane_frames_cross, insane_cross}; +const mmove_t insane_move_cross = {FRAME_cross1, FRAME_cross15, insane_frames_cross, insane_cross}; -mframe_t insane_frames_struggle_cross [] = { +static const mframe_t insane_frames_struggle_cross [] = { { ai_move, 0, insane_scream }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -412,7 +412,7 @@ mframe_t insane_frames_struggle_cross [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t insane_move_struggle_cross = {FRAME_cross16, FRAME_cross30, insane_frames_struggle_cross, insane_cross}; +const mmove_t insane_move_struggle_cross = {FRAME_cross16, FRAME_cross30, insane_frames_struggle_cross, insane_cross}; void insane_cross(edict_t *self) { diff --git a/src/baseq2/m_medic.c b/src/baseq2/m_medic.c index 8e7439afa..83f868953 100644 --- a/src/baseq2/m_medic.c +++ b/src/baseq2/m_medic.c @@ -112,7 +112,7 @@ void medic_sight(edict_t *self, edict_t *other) } -mframe_t medic_frames_stand [] = { +static const mframe_t medic_frames_stand [] = { { ai_stand, 0, medic_idle }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -205,7 +205,7 @@ mframe_t medic_frames_stand [] = { { ai_stand, 0, NULL }, }; -mmove_t medic_move_stand = {FRAME_wait1, FRAME_wait90, medic_frames_stand, NULL}; +const mmove_t medic_move_stand = {FRAME_wait1, FRAME_wait90, medic_frames_stand, NULL}; void medic_stand(edict_t *self) { @@ -213,7 +213,7 @@ void medic_stand(edict_t *self) } -mframe_t medic_frames_walk [] = { +static const mframe_t medic_frames_walk [] = { { ai_walk, 6.2, NULL }, { ai_walk, 18.1, NULL }, { ai_walk, 1, NULL }, @@ -227,7 +227,7 @@ mframe_t medic_frames_walk [] = { { ai_walk, 14, NULL }, { ai_walk, 9.3, NULL } }; -mmove_t medic_move_walk = {FRAME_walk1, FRAME_walk12, medic_frames_walk, NULL}; +const mmove_t medic_move_walk = {FRAME_walk1, FRAME_walk12, medic_frames_walk, NULL}; void medic_walk(edict_t *self) { @@ -235,7 +235,7 @@ void medic_walk(edict_t *self) } -mframe_t medic_frames_run [] = { +static const mframe_t medic_frames_run [] = { { ai_run, 18, NULL }, { ai_run, 22.5, NULL }, { ai_run, 25.4, NULL }, @@ -244,7 +244,7 @@ mframe_t medic_frames_run [] = { { ai_run, 35.6, NULL } }; -mmove_t medic_move_run = {FRAME_run1, FRAME_run6, medic_frames_run, NULL}; +const mmove_t medic_move_run = {FRAME_run1, FRAME_run6, medic_frames_run, NULL}; void medic_run(edict_t *self) { @@ -269,7 +269,7 @@ void medic_run(edict_t *self) } -mframe_t medic_frames_pain1 [] = { +static const mframe_t medic_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -279,9 +279,9 @@ mframe_t medic_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t medic_move_pain1 = {FRAME_paina1, FRAME_paina8, medic_frames_pain1, medic_run}; +const mmove_t medic_move_pain1 = {FRAME_paina1, FRAME_paina8, medic_frames_pain1, medic_run}; -mframe_t medic_frames_pain2 [] = { +static const mframe_t medic_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -298,7 +298,7 @@ mframe_t medic_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t medic_move_pain2 = {FRAME_painb1, FRAME_painb15, medic_frames_pain2, medic_run}; +const mmove_t medic_move_pain2 = {FRAME_painb1, FRAME_painb15, medic_frames_pain2, medic_run}; void medic_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -358,7 +358,7 @@ void medic_dead(edict_t *self) gi.linkentity(self); } -mframe_t medic_frames_death [] = { +static const mframe_t medic_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -390,7 +390,7 @@ mframe_t medic_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t medic_move_death = {FRAME_death1, FRAME_death30, medic_frames_death, medic_dead}; +const mmove_t medic_move_death = {FRAME_death1, FRAME_death30, medic_frames_death, medic_dead}; void medic_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { @@ -451,7 +451,7 @@ void medic_duck_up(edict_t *self) gi.linkentity(self); } -mframe_t medic_frames_duck [] = { +static const mframe_t medic_frames_duck [] = { { ai_move, -1, NULL }, { ai_move, -1, NULL }, { ai_move, -1, medic_duck_down }, @@ -469,7 +469,7 @@ mframe_t medic_frames_duck [] = { { ai_move, -1, NULL }, { ai_move, -1, NULL } }; -mmove_t medic_move_duck = {FRAME_duck1, FRAME_duck16, medic_frames_duck, medic_run}; +const mmove_t medic_move_duck = {FRAME_duck1, FRAME_duck16, medic_frames_duck, medic_run}; void medic_dodge(edict_t *self, edict_t *attacker, float eta) { @@ -482,7 +482,7 @@ void medic_dodge(edict_t *self, edict_t *attacker, float eta) self->monsterinfo.currentmove = &medic_move_duck; } -mframe_t medic_frames_attackHyperBlaster [] = { +static const mframe_t medic_frames_attackHyperBlaster [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -500,7 +500,7 @@ mframe_t medic_frames_attackHyperBlaster [] = { { ai_charge, 0, medic_fire_blaster }, { ai_charge, 0, medic_fire_blaster } }; -mmove_t medic_move_attackHyperBlaster = {FRAME_attack15, FRAME_attack30, medic_frames_attackHyperBlaster, medic_run}; +const mmove_t medic_move_attackHyperBlaster = {FRAME_attack15, FRAME_attack30, medic_frames_attackHyperBlaster, medic_run}; void medic_continue(edict_t *self) @@ -511,7 +511,7 @@ void medic_continue(edict_t *self) } -mframe_t medic_frames_attackBlaster [] = { +static const mframe_t medic_frames_attackBlaster [] = { { ai_charge, 0, NULL }, { ai_charge, 5, NULL }, { ai_charge, 5, NULL }, @@ -527,7 +527,7 @@ mframe_t medic_frames_attackBlaster [] = { { ai_charge, 0, NULL }, { ai_charge, 0, medic_continue } // Change to medic_continue... Else, go to frame 32 }; -mmove_t medic_move_attackBlaster = {FRAME_attack1, FRAME_attack14, medic_frames_attackBlaster, medic_run}; +const mmove_t medic_move_attackBlaster = {FRAME_attack1, FRAME_attack14, medic_frames_attackBlaster, medic_run}; void medic_hook_launch(edict_t *self) @@ -629,7 +629,7 @@ void medic_hook_retract(edict_t *self) self->enemy->monsterinfo.aiflags &= ~AI_RESURRECTING; } -mframe_t medic_frames_attackCable [] = { +static const mframe_t medic_frames_attackCable [] = { { ai_move, 2, NULL }, { ai_move, 3, NULL }, { ai_move, 5, NULL }, @@ -659,7 +659,7 @@ mframe_t medic_frames_attackCable [] = { { ai_move, 1.2, NULL }, { ai_move, 1.3, NULL } }; -mmove_t medic_move_attackCable = {FRAME_attack33, FRAME_attack60, medic_frames_attackCable, medic_run}; +const mmove_t medic_move_attackCable = {FRAME_attack33, FRAME_attack60, medic_frames_attackCable, medic_run}; void medic_attack(edict_t *self) diff --git a/src/baseq2/m_mutant.c b/src/baseq2/m_mutant.c index 4314ad9a0..352e6818b 100644 --- a/src/baseq2/m_mutant.c +++ b/src/baseq2/m_mutant.c @@ -77,7 +77,7 @@ void mutant_swing(edict_t *self) // STAND // -mframe_t mutant_frames_stand [] = { +static const mframe_t mutant_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -135,7 +135,7 @@ mframe_t mutant_frames_stand [] = { { ai_stand, 0, NULL } }; -mmove_t mutant_move_stand = {FRAME_stand101, FRAME_stand151, mutant_frames_stand, NULL}; +const mmove_t mutant_move_stand = {FRAME_stand101, FRAME_stand151, mutant_frames_stand, NULL}; void mutant_stand(edict_t *self) { @@ -153,7 +153,7 @@ void mutant_idle_loop(edict_t *self) self->monsterinfo.nextframe = FRAME_stand155; } -mframe_t mutant_frames_idle [] = { +static const mframe_t mutant_frames_idle [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -168,7 +168,7 @@ mframe_t mutant_frames_idle [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t mutant_move_idle = {FRAME_stand152, FRAME_stand164, mutant_frames_idle, mutant_stand}; +const mmove_t mutant_move_idle = {FRAME_stand152, FRAME_stand164, mutant_frames_idle, mutant_stand}; void mutant_idle(edict_t *self) { @@ -183,7 +183,7 @@ void mutant_idle(edict_t *self) void mutant_walk(edict_t *self); -mframe_t mutant_frames_walk [] = { +static const mframe_t mutant_frames_walk [] = { { ai_walk, 3, NULL }, { ai_walk, 1, NULL }, { ai_walk, 5, NULL }, @@ -197,20 +197,20 @@ mframe_t mutant_frames_walk [] = { { ai_walk, 15, NULL }, { ai_walk, 6, NULL } }; -mmove_t mutant_move_walk = {FRAME_walk05, FRAME_walk16, mutant_frames_walk, NULL}; +const mmove_t mutant_move_walk = {FRAME_walk05, FRAME_walk16, mutant_frames_walk, NULL}; void mutant_walk_loop(edict_t *self) { self->monsterinfo.currentmove = &mutant_move_walk; } -mframe_t mutant_frames_start_walk [] = { +static const mframe_t mutant_frames_start_walk [] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, { ai_walk, -2, NULL }, { ai_walk, 1, NULL } }; -mmove_t mutant_move_start_walk = {FRAME_walk01, FRAME_walk04, mutant_frames_start_walk, mutant_walk_loop}; +const mmove_t mutant_move_start_walk = {FRAME_walk01, FRAME_walk04, mutant_frames_start_walk, mutant_walk_loop}; void mutant_walk(edict_t *self) { @@ -222,7 +222,7 @@ void mutant_walk(edict_t *self) // RUN // -mframe_t mutant_frames_run [] = { +static const mframe_t mutant_frames_run [] = { { ai_run, 40, NULL }, { ai_run, 40, mutant_step }, { ai_run, 24, NULL }, @@ -230,7 +230,7 @@ mframe_t mutant_frames_run [] = { { ai_run, 17, NULL }, { ai_run, 10, NULL } }; -mmove_t mutant_move_run = {FRAME_run03, FRAME_run08, mutant_frames_run, NULL}; +const mmove_t mutant_move_run = {FRAME_run03, FRAME_run08, mutant_frames_run, NULL}; void mutant_run(edict_t *self) { @@ -276,7 +276,7 @@ void mutant_check_refire(edict_t *self) self->monsterinfo.nextframe = FRAME_attack09; } -mframe_t mutant_frames_attack [] = { +static const mframe_t mutant_frames_attack [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, mutant_hit_left }, @@ -285,7 +285,7 @@ mframe_t mutant_frames_attack [] = { { ai_charge, 0, mutant_hit_right }, { ai_charge, 0, mutant_check_refire } }; -mmove_t mutant_move_attack = {FRAME_attack09, FRAME_attack15, mutant_frames_attack, mutant_run}; +const mmove_t mutant_move_attack = {FRAME_attack09, FRAME_attack15, mutant_frames_attack, mutant_run}; void mutant_melee(edict_t *self) { @@ -359,7 +359,7 @@ void mutant_check_landing(edict_t *self) self->monsterinfo.nextframe = FRAME_attack05; } -mframe_t mutant_frames_jump [] = { +static const mframe_t mutant_frames_jump [] = { { ai_charge, 0, NULL }, { ai_charge, 17, NULL }, { ai_charge, 15, mutant_jump_takeoff }, @@ -369,7 +369,7 @@ mframe_t mutant_frames_jump [] = { { ai_charge, 3, NULL }, { ai_charge, 0, NULL } }; -mmove_t mutant_move_jump = {FRAME_attack01, FRAME_attack08, mutant_frames_jump, mutant_run}; +const mmove_t mutant_move_jump = {FRAME_attack01, FRAME_attack08, mutant_frames_jump, mutant_run}; void mutant_jump(edict_t *self) { @@ -438,16 +438,16 @@ bool mutant_checkattack(edict_t *self) // PAIN // -mframe_t mutant_frames_pain1 [] = { +static const mframe_t mutant_frames_pain1 [] = { { ai_move, 4, NULL }, { ai_move, -3, NULL }, { ai_move, -8, NULL }, { ai_move, 2, NULL }, { ai_move, 5, NULL } }; -mmove_t mutant_move_pain1 = {FRAME_pain101, FRAME_pain105, mutant_frames_pain1, mutant_run}; +const mmove_t mutant_move_pain1 = {FRAME_pain101, FRAME_pain105, mutant_frames_pain1, mutant_run}; -mframe_t mutant_frames_pain2 [] = { +static const mframe_t mutant_frames_pain2 [] = { { ai_move, -24, NULL }, { ai_move, 11, NULL }, { ai_move, 5, NULL }, @@ -455,9 +455,9 @@ mframe_t mutant_frames_pain2 [] = { { ai_move, 6, NULL }, { ai_move, 4, NULL } }; -mmove_t mutant_move_pain2 = {FRAME_pain201, FRAME_pain206, mutant_frames_pain2, mutant_run}; +const mmove_t mutant_move_pain2 = {FRAME_pain201, FRAME_pain206, mutant_frames_pain2, mutant_run}; -mframe_t mutant_frames_pain3 [] = { +static const mframe_t mutant_frames_pain3 [] = { { ai_move, -22, NULL }, { ai_move, 3, NULL }, { ai_move, 3, NULL }, @@ -470,7 +470,7 @@ mframe_t mutant_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 1, NULL } }; -mmove_t mutant_move_pain3 = {FRAME_pain301, FRAME_pain311, mutant_frames_pain3, mutant_run}; +const mmove_t mutant_move_pain3 = {FRAME_pain301, FRAME_pain311, mutant_frames_pain3, mutant_run}; void mutant_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -516,7 +516,7 @@ void mutant_dead(edict_t *self) M_FlyCheck(self); } -mframe_t mutant_frames_death1 [] = { +static const mframe_t mutant_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -527,9 +527,9 @@ mframe_t mutant_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t mutant_move_death1 = {FRAME_death101, FRAME_death109, mutant_frames_death1, mutant_dead}; +const mmove_t mutant_move_death1 = {FRAME_death101, FRAME_death109, mutant_frames_death1, mutant_dead}; -mframe_t mutant_frames_death2 [] = { +static const mframe_t mutant_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -541,7 +541,7 @@ mframe_t mutant_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t mutant_move_death2 = {FRAME_death201, FRAME_death210, mutant_frames_death2, mutant_dead}; +const mmove_t mutant_move_death2 = {FRAME_death201, FRAME_death210, mutant_frames_death2, mutant_dead}; void mutant_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { diff --git a/src/baseq2/m_parasite.c b/src/baseq2/m_parasite.c index d52e12bbe..ef280a353 100644 --- a/src/baseq2/m_parasite.c +++ b/src/baseq2/m_parasite.c @@ -81,15 +81,15 @@ void parasite_search(edict_t *self) } -mframe_t parasite_frames_start_fidget [] = { +static const mframe_t parasite_frames_start_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t parasite_move_start_fidget = {FRAME_stand18, FRAME_stand21, parasite_frames_start_fidget, parasite_do_fidget}; +const mmove_t parasite_move_start_fidget = {FRAME_stand18, FRAME_stand21, parasite_frames_start_fidget, parasite_do_fidget}; -mframe_t parasite_frames_fidget [] = { +static const mframe_t parasite_frames_fidget [] = { { ai_stand, 0, parasite_scratch }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -97,9 +97,9 @@ mframe_t parasite_frames_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t parasite_move_fidget = {FRAME_stand22, FRAME_stand27, parasite_frames_fidget, parasite_refidget}; +const mmove_t parasite_move_fidget = {FRAME_stand22, FRAME_stand27, parasite_frames_fidget, parasite_refidget}; -mframe_t parasite_frames_end_fidget [] = { +static const mframe_t parasite_frames_end_fidget [] = { { ai_stand, 0, parasite_scratch }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -109,7 +109,7 @@ mframe_t parasite_frames_end_fidget [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t parasite_move_end_fidget = {FRAME_stand28, FRAME_stand35, parasite_frames_end_fidget, parasite_stand}; +const mmove_t parasite_move_end_fidget = {FRAME_stand28, FRAME_stand35, parasite_frames_end_fidget, parasite_stand}; void parasite_end_fidget(edict_t *self) { @@ -135,7 +135,7 @@ void parasite_idle(edict_t *self) } -mframe_t parasite_frames_stand [] = { +static const mframe_t parasite_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, parasite_tap }, @@ -154,7 +154,7 @@ mframe_t parasite_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, parasite_tap } }; -mmove_t parasite_move_stand = {FRAME_stand01, FRAME_stand17, parasite_frames_stand, parasite_stand}; +const mmove_t parasite_move_stand = {FRAME_stand01, FRAME_stand17, parasite_frames_stand, parasite_stand}; void parasite_stand(edict_t *self) { @@ -162,7 +162,7 @@ void parasite_stand(edict_t *self) } -mframe_t parasite_frames_run [] = { +static const mframe_t parasite_frames_run [] = { { ai_run, 30, NULL }, { ai_run, 30, NULL }, { ai_run, 22, NULL }, @@ -171,15 +171,15 @@ mframe_t parasite_frames_run [] = { { ai_run, 28, NULL }, { ai_run, 25, NULL } }; -mmove_t parasite_move_run = {FRAME_run03, FRAME_run09, parasite_frames_run, NULL}; +const mmove_t parasite_move_run = {FRAME_run03, FRAME_run09, parasite_frames_run, NULL}; -mframe_t parasite_frames_start_run [] = { +static const mframe_t parasite_frames_start_run [] = { { ai_run, 0, NULL }, { ai_run, 30, NULL }, }; -mmove_t parasite_move_start_run = {FRAME_run01, FRAME_run02, parasite_frames_start_run, parasite_run}; +const mmove_t parasite_move_start_run = {FRAME_run01, FRAME_run02, parasite_frames_start_run, parasite_run}; -mframe_t parasite_frames_stop_run [] = { +static const mframe_t parasite_frames_stop_run [] = { { ai_run, 20, NULL }, { ai_run, 20, NULL }, { ai_run, 12, NULL }, @@ -187,7 +187,7 @@ mframe_t parasite_frames_stop_run [] = { { ai_run, 0, NULL }, { ai_run, 0, NULL } }; -mmove_t parasite_move_stop_run = {FRAME_run10, FRAME_run15, parasite_frames_stop_run, NULL}; +const mmove_t parasite_move_stop_run = {FRAME_run10, FRAME_run15, parasite_frames_stop_run, NULL}; void parasite_start_run(edict_t *self) { @@ -206,7 +206,7 @@ void parasite_run(edict_t *self) } -mframe_t parasite_frames_walk [] = { +static const mframe_t parasite_frames_walk [] = { { ai_walk, 30, NULL }, { ai_walk, 30, NULL }, { ai_walk, 22, NULL }, @@ -215,15 +215,15 @@ mframe_t parasite_frames_walk [] = { { ai_walk, 28, NULL }, { ai_walk, 25, NULL } }; -mmove_t parasite_move_walk = {FRAME_run03, FRAME_run09, parasite_frames_walk, parasite_walk}; +const mmove_t parasite_move_walk = {FRAME_run03, FRAME_run09, parasite_frames_walk, parasite_walk}; -mframe_t parasite_frames_start_walk [] = { +static const mframe_t parasite_frames_start_walk [] = { { ai_walk, 0, NULL }, { ai_walk, 30, parasite_walk } }; -mmove_t parasite_move_start_walk = {FRAME_run01, FRAME_run02, parasite_frames_start_walk, NULL}; +const mmove_t parasite_move_start_walk = {FRAME_run01, FRAME_run02, parasite_frames_start_walk, NULL}; -mframe_t parasite_frames_stop_walk [] = { +static const mframe_t parasite_frames_stop_walk [] = { { ai_walk, 20, NULL }, { ai_walk, 20, NULL }, { ai_walk, 12, NULL }, @@ -231,7 +231,7 @@ mframe_t parasite_frames_stop_walk [] = { { ai_walk, 0, NULL }, { ai_walk, 0, NULL } }; -mmove_t parasite_move_stop_walk = {FRAME_run10, FRAME_run15, parasite_frames_stop_walk, NULL}; +const mmove_t parasite_move_stop_walk = {FRAME_run10, FRAME_run15, parasite_frames_stop_walk, NULL}; void parasite_start_walk(edict_t *self) { @@ -244,7 +244,7 @@ void parasite_walk(edict_t *self) } -mframe_t parasite_frames_pain1 [] = { +static const mframe_t parasite_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -257,7 +257,7 @@ mframe_t parasite_frames_pain1 [] = { { ai_move, -7, NULL }, { ai_move, 0, NULL } }; -mmove_t parasite_move_pain1 = {FRAME_pain101, FRAME_pain111, parasite_frames_pain1, parasite_start_run}; +const mmove_t parasite_move_pain1 = {FRAME_pain101, FRAME_pain111, parasite_frames_pain1, parasite_start_run}; void parasite_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -345,7 +345,7 @@ void parasite_drain_attack(edict_t *self) T_Damage(self->enemy, self, self, dir, self->enemy->s.origin, vec3_origin, damage, 0, DAMAGE_NO_KNOCKBACK, MOD_UNKNOWN); } -mframe_t parasite_frames_drain [] = { +static const mframe_t parasite_frames_drain [] = { { ai_charge, 0, parasite_launch }, { ai_charge, 0, NULL }, { ai_charge, 15, parasite_drain_attack }, // Target hits @@ -365,7 +365,7 @@ mframe_t parasite_frames_drain [] = { { ai_charge, -3, NULL }, { ai_charge, 0, NULL } }; -mmove_t parasite_move_drain = {FRAME_drain01, FRAME_drain18, parasite_frames_drain, parasite_start_run}; +const mmove_t parasite_move_drain = {FRAME_drain01, FRAME_drain18, parasite_frames_drain, parasite_start_run}; void parasite_attack(edict_t *self) { @@ -390,7 +390,7 @@ void parasite_dead(edict_t *self) gi.linkentity(self); } -mframe_t parasite_frames_death [] = { +static const mframe_t parasite_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -399,7 +399,7 @@ mframe_t parasite_frames_death [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t parasite_move_death = {FRAME_death101, FRAME_death107, parasite_frames_death, parasite_dead}; +const mmove_t parasite_move_death = {FRAME_death101, FRAME_death107, parasite_frames_death, parasite_dead}; void parasite_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { diff --git a/src/baseq2/m_soldier.c b/src/baseq2/m_soldier.c index 496135feb..b2867b7db 100644 --- a/src/baseq2/m_soldier.c +++ b/src/baseq2/m_soldier.c @@ -58,7 +58,7 @@ void soldier_cock(edict_t *self) void soldier_stand(edict_t *self); -mframe_t soldier_frames_stand1 [] = { +static const mframe_t soldier_frames_stand1 [] = { { ai_stand, 0, soldier_idle }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -92,9 +92,9 @@ mframe_t soldier_frames_stand1 [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t soldier_move_stand1 = {FRAME_stand101, FRAME_stand130, soldier_frames_stand1, soldier_stand}; +const mmove_t soldier_move_stand1 = {FRAME_stand101, FRAME_stand130, soldier_frames_stand1, soldier_stand}; -mframe_t soldier_frames_stand3 [] = { +static const mframe_t soldier_frames_stand3 [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -138,7 +138,7 @@ mframe_t soldier_frames_stand3 [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t soldier_move_stand3 = {FRAME_stand301, FRAME_stand339, soldier_frames_stand3, soldier_stand}; +const mmove_t soldier_move_stand3 = {FRAME_stand301, FRAME_stand339, soldier_frames_stand3, soldier_stand}; void soldier_stand(edict_t *self) { @@ -159,7 +159,7 @@ void soldier_walk1_random(edict_t *self) self->monsterinfo.nextframe = FRAME_walk101; } -mframe_t soldier_frames_walk1 [] = { +static const mframe_t soldier_frames_walk1 [] = { { ai_walk, 3, NULL }, { ai_walk, 6, NULL }, { ai_walk, 2, NULL }, @@ -194,9 +194,9 @@ mframe_t soldier_frames_walk1 [] = { { ai_walk, 0, NULL }, { ai_walk, 0, NULL } }; -mmove_t soldier_move_walk1 = {FRAME_walk101, FRAME_walk133, soldier_frames_walk1, NULL}; +const mmove_t soldier_move_walk1 = {FRAME_walk101, FRAME_walk133, soldier_frames_walk1, NULL}; -mframe_t soldier_frames_walk2 [] = { +static const mframe_t soldier_frames_walk2 [] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, { ai_walk, 9, NULL }, @@ -208,7 +208,7 @@ mframe_t soldier_frames_walk2 [] = { { ai_walk, 6, NULL }, { ai_walk, 7, NULL } }; -mmove_t soldier_move_walk2 = {FRAME_walk209, FRAME_walk218, soldier_frames_walk2, NULL}; +const mmove_t soldier_move_walk2 = {FRAME_walk209, FRAME_walk218, soldier_frames_walk2, NULL}; void soldier_walk(edict_t *self) { @@ -225,13 +225,13 @@ void soldier_walk(edict_t *self) void soldier_run(edict_t *self); -mframe_t soldier_frames_start_run [] = { +static const mframe_t soldier_frames_start_run [] = { { ai_run, 7, NULL }, { ai_run, 5, NULL } }; -mmove_t soldier_move_start_run = {FRAME_run01, FRAME_run02, soldier_frames_start_run, soldier_run}; +const mmove_t soldier_move_start_run = {FRAME_run01, FRAME_run02, soldier_frames_start_run, soldier_run}; -mframe_t soldier_frames_run [] = { +static const mframe_t soldier_frames_run [] = { { ai_run, 10, NULL }, { ai_run, 11, NULL }, { ai_run, 11, NULL }, @@ -239,7 +239,7 @@ mframe_t soldier_frames_run [] = { { ai_run, 10, NULL }, { ai_run, 15, NULL } }; -mmove_t soldier_move_run = {FRAME_run03, FRAME_run08, soldier_frames_run, NULL}; +const mmove_t soldier_move_run = {FRAME_run03, FRAME_run08, soldier_frames_run, NULL}; void soldier_run(edict_t *self) { @@ -262,16 +262,16 @@ void soldier_run(edict_t *self) // PAIN // -mframe_t soldier_frames_pain1 [] = { +static const mframe_t soldier_frames_pain1 [] = { { ai_move, -3, NULL }, { ai_move, 4, NULL }, { ai_move, 1, NULL }, { ai_move, 1, NULL }, { ai_move, 0, NULL } }; -mmove_t soldier_move_pain1 = {FRAME_pain101, FRAME_pain105, soldier_frames_pain1, soldier_run}; +const mmove_t soldier_move_pain1 = {FRAME_pain101, FRAME_pain105, soldier_frames_pain1, soldier_run}; -mframe_t soldier_frames_pain2 [] = { +static const mframe_t soldier_frames_pain2 [] = { { ai_move, -13, NULL }, { ai_move, -1, NULL }, { ai_move, 2, NULL }, @@ -280,9 +280,9 @@ mframe_t soldier_frames_pain2 [] = { { ai_move, 3, NULL }, { ai_move, 2, NULL } }; -mmove_t soldier_move_pain2 = {FRAME_pain201, FRAME_pain207, soldier_frames_pain2, soldier_run}; +const mmove_t soldier_move_pain2 = {FRAME_pain201, FRAME_pain207, soldier_frames_pain2, soldier_run}; -mframe_t soldier_frames_pain3 [] = { +static const mframe_t soldier_frames_pain3 [] = { { ai_move, -8, NULL }, { ai_move, 10, NULL }, { ai_move, -4, NULL }, @@ -302,9 +302,9 @@ mframe_t soldier_frames_pain3 [] = { { ai_move, 3, NULL }, { ai_move, 2, NULL } }; -mmove_t soldier_move_pain3 = {FRAME_pain301, FRAME_pain318, soldier_frames_pain3, soldier_run}; +const mmove_t soldier_move_pain3 = {FRAME_pain301, FRAME_pain318, soldier_frames_pain3, soldier_run}; -mframe_t soldier_frames_pain4 [] = { +static const mframe_t soldier_frames_pain4 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -323,7 +323,7 @@ mframe_t soldier_frames_pain4 [] = { { ai_move, 2, NULL }, { ai_move, 0, NULL } }; -mmove_t soldier_move_pain4 = {FRAME_pain401, FRAME_pain417, soldier_frames_pain4, soldier_run}; +const mmove_t soldier_move_pain4 = {FRAME_pain401, FRAME_pain417, soldier_frames_pain4, soldier_run}; void soldier_pain(edict_t *self, edict_t *other, float kick, int damage) @@ -466,7 +466,7 @@ void soldier_attack1_refire2(edict_t *self) self->monsterinfo.nextframe = FRAME_attak102; } -mframe_t soldier_frames_attack1 [] = { +static const mframe_t soldier_frames_attack1 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, soldier_fire1 }, @@ -480,7 +480,7 @@ mframe_t soldier_frames_attack1 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t soldier_move_attack1 = {FRAME_attak101, FRAME_attak112, soldier_frames_attack1, soldier_run}; +const mmove_t soldier_move_attack1 = {FRAME_attak101, FRAME_attak112, soldier_frames_attack1, soldier_run}; // ATTACK2 (blaster/shotgun) @@ -515,7 +515,7 @@ void soldier_attack2_refire2(edict_t *self) self->monsterinfo.nextframe = FRAME_attak204; } -mframe_t soldier_frames_attack2 [] = { +static const mframe_t soldier_frames_attack2 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -535,7 +535,7 @@ mframe_t soldier_frames_attack2 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t soldier_move_attack2 = {FRAME_attak201, FRAME_attak218, soldier_frames_attack2, soldier_run}; +const mmove_t soldier_move_attack2 = {FRAME_attak201, FRAME_attak218, soldier_frames_attack2, soldier_run}; // ATTACK3 (duck and shoot) @@ -570,7 +570,7 @@ void soldier_attack3_refire(edict_t *self) self->monsterinfo.nextframe = FRAME_attak303; } -mframe_t soldier_frames_attack3 [] = { +static const mframe_t soldier_frames_attack3 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, soldier_fire3 }, @@ -581,7 +581,7 @@ mframe_t soldier_frames_attack3 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t soldier_move_attack3 = {FRAME_attak301, FRAME_attak309, soldier_frames_attack3, soldier_run}; +const mmove_t soldier_move_attack3 = {FRAME_attak301, FRAME_attak309, soldier_frames_attack3, soldier_run}; // ATTACK4 (machinegun) @@ -590,7 +590,7 @@ void soldier_fire4(edict_t *self) soldier_fire(self, 3); } -mframe_t soldier_frames_attack4 [] = { +static const mframe_t soldier_frames_attack4 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, soldier_fire4 }, @@ -598,7 +598,7 @@ mframe_t soldier_frames_attack4 [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t soldier_move_attack4 = {FRAME_attak401, FRAME_attak406, soldier_frames_attack4, soldier_run}; +const mmove_t soldier_move_attack4 = {FRAME_attak401, FRAME_attak406, soldier_frames_attack4, soldier_run}; // ATTACK6 (run & shoot) @@ -619,7 +619,7 @@ void soldier_attack6_refire(edict_t *self) self->monsterinfo.nextframe = FRAME_runs03; } -mframe_t soldier_frames_attack6 [] = { +static const mframe_t soldier_frames_attack6 [] = { { ai_charge, 10, NULL }, { ai_charge, 4, NULL }, { ai_charge, 12, NULL }, @@ -635,7 +635,7 @@ mframe_t soldier_frames_attack6 [] = { { ai_charge, 12, NULL }, { ai_charge, 17, soldier_attack6_refire } }; -mmove_t soldier_move_attack6 = {FRAME_runs01, FRAME_runs14, soldier_frames_attack6, soldier_run}; +const mmove_t soldier_move_attack6 = {FRAME_runs01, FRAME_runs14, soldier_frames_attack6, soldier_run}; void soldier_attack(edict_t *self) { @@ -679,14 +679,14 @@ void soldier_duck_hold(edict_t *self) self->monsterinfo.aiflags |= AI_HOLD_FRAME; } -mframe_t soldier_frames_duck [] = { +static const mframe_t soldier_frames_duck [] = { { ai_move, 5, soldier_duck_down }, { ai_move, -1, soldier_duck_hold }, { ai_move, 1, NULL }, { ai_move, 0, soldier_duck_up }, { ai_move, 5, NULL } }; -mmove_t soldier_move_duck = {FRAME_duck01, FRAME_duck05, soldier_frames_duck, soldier_run}; +const mmove_t soldier_move_duck = {FRAME_duck01, FRAME_duck05, soldier_frames_duck, soldier_run}; void soldier_dodge(edict_t *self, edict_t *attacker, float eta) { @@ -751,7 +751,7 @@ void soldier_dead(edict_t *self) gi.linkentity(self); } -mframe_t soldier_frames_death1 [] = { +static const mframe_t soldier_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, -10, NULL }, { ai_move, -10, NULL }, @@ -792,9 +792,9 @@ mframe_t soldier_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t soldier_move_death1 = {FRAME_death101, FRAME_death136, soldier_frames_death1, soldier_dead}; +const mmove_t soldier_move_death1 = {FRAME_death101, FRAME_death136, soldier_frames_death1, soldier_dead}; -mframe_t soldier_frames_death2 [] = { +static const mframe_t soldier_frames_death2 [] = { { ai_move, -5, NULL }, { ai_move, -5, NULL }, { ai_move, -5, NULL }, @@ -834,9 +834,9 @@ mframe_t soldier_frames_death2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t soldier_move_death2 = {FRAME_death201, FRAME_death235, soldier_frames_death2, soldier_dead}; +const mmove_t soldier_move_death2 = {FRAME_death201, FRAME_death235, soldier_frames_death2, soldier_dead}; -mframe_t soldier_frames_death3 [] = { +static const mframe_t soldier_frames_death3 [] = { { ai_move, -5, NULL }, { ai_move, -5, NULL }, { ai_move, -5, NULL }, @@ -887,9 +887,9 @@ mframe_t soldier_frames_death3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, }; -mmove_t soldier_move_death3 = {FRAME_death301, FRAME_death345, soldier_frames_death3, soldier_dead}; +const mmove_t soldier_move_death3 = {FRAME_death301, FRAME_death345, soldier_frames_death3, soldier_dead}; -mframe_t soldier_frames_death4 [] = { +static const mframe_t soldier_frames_death4 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -949,9 +949,9 @@ mframe_t soldier_frames_death4 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t soldier_move_death4 = {FRAME_death401, FRAME_death453, soldier_frames_death4, soldier_dead}; +const mmove_t soldier_move_death4 = {FRAME_death401, FRAME_death453, soldier_frames_death4, soldier_dead}; -mframe_t soldier_frames_death5 [] = { +static const mframe_t soldier_frames_death5 [] = { { ai_move, -5, NULL }, { ai_move, -5, NULL }, { ai_move, -5, NULL }, @@ -979,9 +979,9 @@ mframe_t soldier_frames_death5 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t soldier_move_death5 = {FRAME_death501, FRAME_death524, soldier_frames_death5, soldier_dead}; +const mmove_t soldier_move_death5 = {FRAME_death501, FRAME_death524, soldier_frames_death5, soldier_dead}; -mframe_t soldier_frames_death6 [] = { +static const mframe_t soldier_frames_death6 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -993,7 +993,7 @@ mframe_t soldier_frames_death6 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t soldier_move_death6 = {FRAME_death601, FRAME_death610, soldier_frames_death6, soldier_dead}; +const mmove_t soldier_move_death6 = {FRAME_death601, FRAME_death610, soldier_frames_death6, soldier_dead}; void soldier_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { diff --git a/src/baseq2/m_supertank.c b/src/baseq2/m_supertank.c index da2d57990..35ca74606 100644 --- a/src/baseq2/m_supertank.c +++ b/src/baseq2/m_supertank.c @@ -63,7 +63,7 @@ void supertank_reattack1(edict_t *self); // stand // -mframe_t supertank_frames_stand [] = { +static const mframe_t supertank_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -125,7 +125,7 @@ mframe_t supertank_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t supertank_move_stand = {FRAME_stand_1, FRAME_stand_60, supertank_frames_stand, NULL}; +const mmove_t supertank_move_stand = {FRAME_stand_1, FRAME_stand_60, supertank_frames_stand, NULL}; void supertank_stand(edict_t *self) { @@ -133,7 +133,7 @@ void supertank_stand(edict_t *self) } -mframe_t supertank_frames_run [] = { +static const mframe_t supertank_frames_run [] = { { ai_run, 12, TreadSound }, { ai_run, 12, NULL }, { ai_run, 12, NULL }, @@ -153,14 +153,14 @@ mframe_t supertank_frames_run [] = { { ai_run, 12, NULL }, { ai_run, 12, NULL } }; -mmove_t supertank_move_run = {FRAME_forwrd_1, FRAME_forwrd_18, supertank_frames_run, NULL}; +const mmove_t supertank_move_run = {FRAME_forwrd_1, FRAME_forwrd_18, supertank_frames_run, NULL}; // // walk // -mframe_t supertank_frames_forward [] = { +static const mframe_t supertank_frames_forward [] = { { ai_walk, 4, TreadSound }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -180,7 +180,7 @@ mframe_t supertank_frames_forward [] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL } }; -mmove_t supertank_move_forward = {FRAME_forwrd_1, FRAME_forwrd_18, supertank_frames_forward, NULL}; +const mmove_t supertank_move_forward = {FRAME_forwrd_1, FRAME_forwrd_18, supertank_frames_forward, NULL}; void supertank_forward(edict_t *self) { @@ -200,7 +200,7 @@ void supertank_run(edict_t *self) self->monsterinfo.currentmove = &supertank_move_run; } -mframe_t supertank_frames_turn_right [] = { +static const mframe_t supertank_frames_turn_right [] = { { ai_move, 0, TreadSound }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -220,9 +220,9 @@ mframe_t supertank_frames_turn_right [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_turn_right = {FRAME_right_1, FRAME_right_18, supertank_frames_turn_right, supertank_run}; +const mmove_t supertank_move_turn_right = {FRAME_right_1, FRAME_right_18, supertank_frames_turn_right, supertank_run}; -mframe_t supertank_frames_turn_left [] = { +static const mframe_t supertank_frames_turn_left [] = { { ai_move, 0, TreadSound }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -242,34 +242,34 @@ mframe_t supertank_frames_turn_left [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_turn_left = {FRAME_left_1, FRAME_left_18, supertank_frames_turn_left, supertank_run}; +const mmove_t supertank_move_turn_left = {FRAME_left_1, FRAME_left_18, supertank_frames_turn_left, supertank_run}; -mframe_t supertank_frames_pain3 [] = { +static const mframe_t supertank_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_pain3 = {FRAME_pain3_9, FRAME_pain3_12, supertank_frames_pain3, supertank_run}; +const mmove_t supertank_move_pain3 = {FRAME_pain3_9, FRAME_pain3_12, supertank_frames_pain3, supertank_run}; -mframe_t supertank_frames_pain2 [] = { +static const mframe_t supertank_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_pain2 = {FRAME_pain2_5, FRAME_pain2_8, supertank_frames_pain2, supertank_run}; +const mmove_t supertank_move_pain2 = {FRAME_pain2_5, FRAME_pain2_8, supertank_frames_pain2, supertank_run}; -mframe_t supertank_frames_pain1 [] = { +static const mframe_t supertank_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_pain1 = {FRAME_pain1_1, FRAME_pain1_4, supertank_frames_pain1, supertank_run}; +const mmove_t supertank_move_pain1 = {FRAME_pain1_1, FRAME_pain1_4, supertank_frames_pain1, supertank_run}; -mframe_t supertank_frames_death1 [] = { +static const mframe_t supertank_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -295,9 +295,9 @@ mframe_t supertank_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, BossExplode } }; -mmove_t supertank_move_death = {FRAME_death_1, FRAME_death_24, supertank_frames_death1, supertank_dead}; +const mmove_t supertank_move_death = {FRAME_death_1, FRAME_death_24, supertank_frames_death1, supertank_dead}; -mframe_t supertank_frames_backward[] = { +static const mframe_t supertank_frames_backward[] = { { ai_walk, 0, TreadSound }, { ai_walk, 0, NULL }, { ai_walk, 0, NULL }, @@ -317,9 +317,9 @@ mframe_t supertank_frames_backward[] = { { ai_walk, 0, NULL }, { ai_walk, 0, NULL } }; -mmove_t supertank_move_backward = {FRAME_backwd_1, FRAME_backwd_18, supertank_frames_backward, NULL}; +const mmove_t supertank_move_backward = {FRAME_backwd_1, FRAME_backwd_18, supertank_frames_backward, NULL}; -mframe_t supertank_frames_attack4[] = { +static const mframe_t supertank_frames_attack4[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -327,9 +327,9 @@ mframe_t supertank_frames_attack4[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_attack4 = {FRAME_attak4_1, FRAME_attak4_6, supertank_frames_attack4, supertank_run}; +const mmove_t supertank_move_attack4 = {FRAME_attak4_1, FRAME_attak4_6, supertank_frames_attack4, supertank_run}; -mframe_t supertank_frames_attack3[] = { +static const mframe_t supertank_frames_attack3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -358,9 +358,9 @@ mframe_t supertank_frames_attack3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_attack3 = {FRAME_attak3_1, FRAME_attak3_27, supertank_frames_attack3, supertank_run}; +const mmove_t supertank_move_attack3 = {FRAME_attak3_1, FRAME_attak3_27, supertank_frames_attack3, supertank_run}; -mframe_t supertank_frames_attack2[] = { +static const mframe_t supertank_frames_attack2[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -389,9 +389,9 @@ mframe_t supertank_frames_attack2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_attack2 = {FRAME_attak2_1, FRAME_attak2_27, supertank_frames_attack2, supertank_run}; +const mmove_t supertank_move_attack2 = {FRAME_attak2_1, FRAME_attak2_27, supertank_frames_attack2, supertank_run}; -mframe_t supertank_frames_attack1[] = { +static const mframe_t supertank_frames_attack1[] = { { ai_charge, 0, supertankMachineGun }, { ai_charge, 0, supertankMachineGun }, { ai_charge, 0, supertankMachineGun }, @@ -400,9 +400,9 @@ mframe_t supertank_frames_attack1[] = { { ai_charge, 0, supertankMachineGun }, }; -mmove_t supertank_move_attack1 = {FRAME_attak1_1, FRAME_attak1_6, supertank_frames_attack1, supertank_reattack1}; +const mmove_t supertank_move_attack1 = {FRAME_attak1_1, FRAME_attak1_6, supertank_frames_attack1, supertank_reattack1}; -mframe_t supertank_frames_end_attack1[] = { +static const mframe_t supertank_frames_end_attack1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -418,7 +418,7 @@ mframe_t supertank_frames_end_attack1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t supertank_move_end_attack1 = {FRAME_attak1_7, FRAME_attak1_20, supertank_frames_end_attack1, supertank_run}; +const mmove_t supertank_move_end_attack1 = {FRAME_attak1_7, FRAME_attak1_20, supertank_frames_end_attack1, supertank_run}; void supertank_reattack1(edict_t *self) diff --git a/src/baseq2/m_tank.c b/src/baseq2/m_tank.c index e665de32e..98d69adc1 100644 --- a/src/baseq2/m_tank.c +++ b/src/baseq2/m_tank.c @@ -75,7 +75,7 @@ void tank_idle(edict_t *self) // stand // -mframe_t tank_frames_stand [] = { +static const mframe_t tank_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -107,7 +107,7 @@ mframe_t tank_frames_stand [] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL } }; -mmove_t tank_move_stand = {FRAME_stand01, FRAME_stand30, tank_frames_stand, NULL}; +const mmove_t tank_move_stand = {FRAME_stand01, FRAME_stand30, tank_frames_stand, NULL}; void tank_stand(edict_t *self) { @@ -121,15 +121,15 @@ void tank_stand(edict_t *self) void tank_walk(edict_t *self); -mframe_t tank_frames_start_walk [] = { +static const mframe_t tank_frames_start_walk [] = { { ai_walk, 0, NULL }, { ai_walk, 6, NULL }, { ai_walk, 6, NULL }, { ai_walk, 11, tank_footstep } }; -mmove_t tank_move_start_walk = {FRAME_walk01, FRAME_walk04, tank_frames_start_walk, tank_walk}; +const mmove_t tank_move_start_walk = {FRAME_walk01, FRAME_walk04, tank_frames_start_walk, tank_walk}; -mframe_t tank_frames_walk [] = { +static const mframe_t tank_frames_walk [] = { { ai_walk, 4, NULL }, { ai_walk, 5, NULL }, { ai_walk, 3, NULL }, @@ -147,16 +147,16 @@ mframe_t tank_frames_walk [] = { { ai_walk, 6, NULL }, { ai_walk, 6, tank_footstep } }; -mmove_t tank_move_walk = {FRAME_walk05, FRAME_walk20, tank_frames_walk, NULL}; +const mmove_t tank_move_walk = {FRAME_walk05, FRAME_walk20, tank_frames_walk, NULL}; -mframe_t tank_frames_stop_walk [] = { +static const mframe_t tank_frames_stop_walk [] = { { ai_walk, 3, NULL }, { ai_walk, 3, NULL }, { ai_walk, 2, NULL }, { ai_walk, 2, NULL }, { ai_walk, 4, tank_footstep } }; -mmove_t tank_move_stop_walk = {FRAME_walk21, FRAME_walk25, tank_frames_stop_walk, tank_stand}; +const mmove_t tank_move_stop_walk = {FRAME_walk21, FRAME_walk25, tank_frames_stop_walk, tank_stand}; void tank_walk(edict_t *self) { @@ -170,15 +170,15 @@ void tank_walk(edict_t *self) void tank_run(edict_t *self); -mframe_t tank_frames_start_run [] = { +static const mframe_t tank_frames_start_run [] = { { ai_run, 0, NULL }, { ai_run, 6, NULL }, { ai_run, 6, NULL }, { ai_run, 11, tank_footstep } }; -mmove_t tank_move_start_run = {FRAME_walk01, FRAME_walk04, tank_frames_start_run, tank_run}; +const mmove_t tank_move_start_run = {FRAME_walk01, FRAME_walk04, tank_frames_start_run, tank_run}; -mframe_t tank_frames_run [] = { +static const mframe_t tank_frames_run [] = { { ai_run, 4, NULL }, { ai_run, 5, NULL }, { ai_run, 3, NULL }, @@ -196,16 +196,16 @@ mframe_t tank_frames_run [] = { { ai_run, 6, NULL }, { ai_run, 6, tank_footstep } }; -mmove_t tank_move_run = {FRAME_walk05, FRAME_walk20, tank_frames_run, NULL}; +const mmove_t tank_move_run = {FRAME_walk05, FRAME_walk20, tank_frames_run, NULL}; -mframe_t tank_frames_stop_run [] = { +static const mframe_t tank_frames_stop_run [] = { { ai_run, 3, NULL }, { ai_run, 3, NULL }, { ai_run, 2, NULL }, { ai_run, 2, NULL }, { ai_run, 4, tank_footstep } }; -mmove_t tank_move_stop_run = {FRAME_walk21, FRAME_walk25, tank_frames_stop_run, tank_walk}; +const mmove_t tank_move_stop_run = {FRAME_walk21, FRAME_walk25, tank_frames_stop_run, tank_walk}; void tank_run(edict_t *self) { @@ -231,24 +231,24 @@ void tank_run(edict_t *self) // pain // -mframe_t tank_frames_pain1 [] = { +static const mframe_t tank_frames_pain1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t tank_move_pain1 = {FRAME_pain101, FRAME_pain104, tank_frames_pain1, tank_run}; +const mmove_t tank_move_pain1 = {FRAME_pain101, FRAME_pain104, tank_frames_pain1, tank_run}; -mframe_t tank_frames_pain2 [] = { +static const mframe_t tank_frames_pain2 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t tank_move_pain2 = {FRAME_pain201, FRAME_pain205, tank_frames_pain2, tank_run}; +const mmove_t tank_move_pain2 = {FRAME_pain201, FRAME_pain205, tank_frames_pain2, tank_run}; -mframe_t tank_frames_pain3 [] = { +static const mframe_t tank_frames_pain3 [] = { { ai_move, -7, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -266,7 +266,7 @@ mframe_t tank_frames_pain3 [] = { { ai_move, 0, NULL }, { ai_move, 0, tank_footstep } }; -mmove_t tank_move_pain3 = {FRAME_pain301, FRAME_pain316, tank_frames_pain3, tank_run}; +const mmove_t tank_move_pain3 = {FRAME_pain301, FRAME_pain316, tank_frames_pain3, tank_run}; void tank_pain(edict_t *self, edict_t *other, float kick, int damage) @@ -401,7 +401,7 @@ void TankMachineGun(edict_t *self) } -mframe_t tank_frames_attack_blast [] = { +static const mframe_t tank_frames_attack_blast [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -419,9 +419,9 @@ mframe_t tank_frames_attack_blast [] = { { ai_charge, 0, NULL }, { ai_charge, 0, TankBlaster } // 16 }; -mmove_t tank_move_attack_blast = {FRAME_attak101, FRAME_attak116, tank_frames_attack_blast, tank_reattack_blaster}; +const mmove_t tank_move_attack_blast = {FRAME_attak101, FRAME_attak116, tank_frames_attack_blast, tank_reattack_blaster}; -mframe_t tank_frames_reattack_blast [] = { +static const mframe_t tank_frames_reattack_blast [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, TankBlaster }, @@ -429,9 +429,9 @@ mframe_t tank_frames_reattack_blast [] = { { ai_charge, 0, NULL }, { ai_charge, 0, TankBlaster } // 16 }; -mmove_t tank_move_reattack_blast = {FRAME_attak111, FRAME_attak116, tank_frames_reattack_blast, tank_reattack_blaster}; +const mmove_t tank_move_reattack_blast = {FRAME_attak111, FRAME_attak116, tank_frames_reattack_blast, tank_reattack_blaster}; -mframe_t tank_frames_attack_post_blast [] = { +static const mframe_t tank_frames_attack_post_blast [] = { { ai_move, 0, NULL }, // 17 { ai_move, 0, NULL }, { ai_move, 2, NULL }, @@ -439,7 +439,7 @@ mframe_t tank_frames_attack_post_blast [] = { { ai_move, 2, NULL }, { ai_move, -2, tank_footstep } // 22 }; -mmove_t tank_move_attack_post_blast = {FRAME_attak117, FRAME_attak122, tank_frames_attack_post_blast, tank_run}; +const mmove_t tank_move_attack_post_blast = {FRAME_attak117, FRAME_attak122, tank_frames_attack_post_blast, tank_run}; void tank_reattack_blaster(edict_t *self) { @@ -460,7 +460,7 @@ void tank_poststrike(edict_t *self) tank_run(self); } -mframe_t tank_frames_attack_strike [] = { +static const mframe_t tank_frames_attack_strike [] = { { ai_move, 3, NULL }, { ai_move, 2, NULL }, { ai_move, 2, NULL }, @@ -500,9 +500,9 @@ mframe_t tank_frames_attack_strike [] = { { ai_move, -3, NULL }, { ai_move, -2, tank_footstep } }; -mmove_t tank_move_attack_strike = {FRAME_attak201, FRAME_attak238, tank_frames_attack_strike, tank_poststrike}; +const mmove_t tank_move_attack_strike = {FRAME_attak201, FRAME_attak238, tank_frames_attack_strike, tank_poststrike}; -mframe_t tank_frames_attack_pre_rocket [] = { +static const mframe_t tank_frames_attack_pre_rocket [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -527,9 +527,9 @@ mframe_t tank_frames_attack_pre_rocket [] = { { ai_charge, -3, NULL } }; -mmove_t tank_move_attack_pre_rocket = {FRAME_attak301, FRAME_attak321, tank_frames_attack_pre_rocket, tank_doattack_rocket}; +const mmove_t tank_move_attack_pre_rocket = {FRAME_attak301, FRAME_attak321, tank_frames_attack_pre_rocket, tank_doattack_rocket}; -mframe_t tank_frames_attack_fire_rocket [] = { +static const mframe_t tank_frames_attack_fire_rocket [] = { { ai_charge, -3, NULL }, // Loop Start 22 { ai_charge, 0, NULL }, { ai_charge, 0, TankRocket }, // 24 @@ -540,9 +540,9 @@ mframe_t tank_frames_attack_fire_rocket [] = { { ai_charge, 0, NULL }, { ai_charge, -1, TankRocket } // 30 Loop End }; -mmove_t tank_move_attack_fire_rocket = {FRAME_attak322, FRAME_attak330, tank_frames_attack_fire_rocket, tank_refire_rocket}; +const mmove_t tank_move_attack_fire_rocket = {FRAME_attak322, FRAME_attak330, tank_frames_attack_fire_rocket, tank_refire_rocket}; -mframe_t tank_frames_attack_post_rocket [] = { +static const mframe_t tank_frames_attack_post_rocket [] = { { ai_charge, 0, NULL }, // 31 { ai_charge, -1, NULL }, { ai_charge, -1, NULL }, @@ -569,9 +569,9 @@ mframe_t tank_frames_attack_post_rocket [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t tank_move_attack_post_rocket = {FRAME_attak331, FRAME_attak353, tank_frames_attack_post_rocket, tank_run}; +const mmove_t tank_move_attack_post_rocket = {FRAME_attak331, FRAME_attak353, tank_frames_attack_post_rocket, tank_run}; -mframe_t tank_frames_attack_chain [] = { +static const mframe_t tank_frames_attack_chain [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -602,7 +602,7 @@ mframe_t tank_frames_attack_chain [] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; -mmove_t tank_move_attack_chain = {FRAME_attak401, FRAME_attak429, tank_frames_attack_chain, tank_run}; +const mmove_t tank_move_attack_chain = {FRAME_attak401, FRAME_attak429, tank_frames_attack_chain, tank_run}; void tank_refire_rocket(edict_t *self) { @@ -675,7 +675,7 @@ void tank_dead(edict_t *self) gi.linkentity(self); } -mframe_t tank_frames_death1 [] = { +static const mframe_t tank_frames_death1 [] = { { ai_move, -7, NULL }, { ai_move, -2, NULL }, { ai_move, -2, NULL }, @@ -709,7 +709,7 @@ mframe_t tank_frames_death1 [] = { { ai_move, 0, NULL }, { ai_move, 0, NULL } }; -mmove_t tank_move_death = {FRAME_death101, FRAME_death132, tank_frames_death1, tank_dead}; +const mmove_t tank_move_death = {FRAME_death101, FRAME_death132, tank_frames_death1, tank_dead}; void tank_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { From 405c6b9304b5cb4394698385e0f166251e34d320 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 17 Aug 2023 14:28:34 +0300 Subject: [PATCH 10/15] Const-ify remaining statically initialized data. --- src/baseq2/g_utils.c | 8 ++++---- src/baseq2/m_actor.c | 6 +++--- src/baseq2/m_berserk.c | 2 +- src/baseq2/m_float.c | 2 +- src/baseq2/m_infantry.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/baseq2/g_utils.c b/src/baseq2/g_utils.c index 22c857c27..ac8bf2347 100644 --- a/src/baseq2/g_utils.c +++ b/src/baseq2/g_utils.c @@ -237,10 +237,10 @@ void G_UseTargets(edict_t *ent, edict_t *activator) } -vec3_t VEC_UP = {0, -1, 0}; -vec3_t MOVEDIR_UP = {0, 0, 1}; -vec3_t VEC_DOWN = {0, -2, 0}; -vec3_t MOVEDIR_DOWN = {0, 0, -1}; +static const vec3_t VEC_UP = {0, -1, 0}; +static const vec3_t MOVEDIR_UP = {0, 0, 1}; +static const vec3_t VEC_DOWN = {0, -2, 0}; +static const vec3_t MOVEDIR_DOWN = {0, 0, -1}; void G_SetMovedir(vec3_t angles, vec3_t movedir) { diff --git a/src/baseq2/m_actor.c b/src/baseq2/m_actor.c index dc81a48b1..0b8d30558 100644 --- a/src/baseq2/m_actor.c +++ b/src/baseq2/m_actor.c @@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "m_actor.h" #define MAX_ACTOR_NAMES 8 -char *actor_names[MAX_ACTOR_NAMES] = { +static const char *const actor_names[MAX_ACTOR_NAMES] = { "Hellrot", "Tokay", "Killme", @@ -206,7 +206,7 @@ static const mframe_t actor_frames_taunt [] = { }; const mmove_t actor_move_taunt = {FRAME_taunt01, FRAME_taunt17, actor_frames_taunt, actor_run}; -char *messages[] = { +static const char *const messages[] = { "Watch it", "#$@*&", "Idiot", @@ -228,7 +228,7 @@ void actor_pain(edict_t *self, edict_t *other, float kick, int damage) if ((other->client) && (random() < 0.4f)) { vec3_t v; - char *name; + const char *name; VectorSubtract(other->s.origin, self->s.origin, v); self->ideal_yaw = vectoyaw(v); diff --git a/src/baseq2/m_berserk.c b/src/baseq2/m_berserk.c index 67005e7b7..ae74b2f63 100644 --- a/src/baseq2/m_berserk.c +++ b/src/baseq2/m_berserk.c @@ -163,7 +163,7 @@ void berserk_run(edict_t *self) void berserk_attack_spike(edict_t *self) { - static vec3_t aim = {MELEE_DISTANCE, 0, -24}; + vec3_t aim = {MELEE_DISTANCE, 0, -24}; fire_hit(self, aim, (15 + (Q_rand() % 6)), 400); // Faster attack -- upwards and backwards } diff --git a/src/baseq2/m_float.c b/src/baseq2/m_float.c index 9daad097e..8a4221a4b 100644 --- a/src/baseq2/m_float.c +++ b/src/baseq2/m_float.c @@ -500,7 +500,7 @@ void floater_walk(edict_t *self) void floater_wham(edict_t *self) { - static vec3_t aim = {MELEE_DISTANCE, 0, 0}; + vec3_t aim = {MELEE_DISTANCE, 0, 0}; gi.sound(self, CHAN_WEAPON, sound_attack3, 1, ATTN_NORM, 0); fire_hit(self, aim, 5 + Q_rand() % 6, -50); } diff --git a/src/baseq2/m_infantry.c b/src/baseq2/m_infantry.c index 0994a1fb0..de80a0075 100644 --- a/src/baseq2/m_infantry.c +++ b/src/baseq2/m_infantry.c @@ -230,7 +230,7 @@ void infantry_pain(edict_t *self, edict_t *other, float kick, int damage) } -vec3_t aimangles[] = { +static const vec3_t aimangles[] = { { 0.0, 5.0, 0.0 }, { 10.0, 15.0, 0.0 }, { 20.0, 25.0, 0.0 }, From c7e08cae902b2554ae344ddc3584c9dc63f6208a Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 17 Aug 2023 22:06:52 +0300 Subject: [PATCH 11/15] Const-ify more missed stuff. --- src/baseq2/m_medic.c | 2 +- src/baseq2/m_soldier.c | 35 ++++++++++++++++++++++++++++++++--- src/baseq2/p_view.c | 6 +++--- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/baseq2/m_medic.c b/src/baseq2/m_medic.c index 83f868953..0c021ecc4 100644 --- a/src/baseq2/m_medic.c +++ b/src/baseq2/m_medic.c @@ -537,7 +537,7 @@ void medic_hook_launch(edict_t *self) void ED_CallSpawn(edict_t *ent); -static vec3_t medic_cable_offsets[] = { +static const vec3_t medic_cable_offsets[] = { { 45.0, -9.2, 15.5 }, { 48.4, -9.7, 15.2 }, { 47.8, -9.8, 15.8 }, diff --git a/src/baseq2/m_soldier.c b/src/baseq2/m_soldier.c index b2867b7db..4f567af4d 100644 --- a/src/baseq2/m_soldier.c +++ b/src/baseq2/m_soldier.c @@ -373,9 +373,38 @@ void soldier_pain(edict_t *self, edict_t *other, float kick, int damage) // ATTACK // -static int blaster_flash [] = {MZ2_SOLDIER_BLASTER_1, MZ2_SOLDIER_BLASTER_2, MZ2_SOLDIER_BLASTER_3, MZ2_SOLDIER_BLASTER_4, MZ2_SOLDIER_BLASTER_5, MZ2_SOLDIER_BLASTER_6, MZ2_SOLDIER_BLASTER_7, MZ2_SOLDIER_BLASTER_8}; -static int shotgun_flash [] = {MZ2_SOLDIER_SHOTGUN_1, MZ2_SOLDIER_SHOTGUN_2, MZ2_SOLDIER_SHOTGUN_3, MZ2_SOLDIER_SHOTGUN_4, MZ2_SOLDIER_SHOTGUN_5, MZ2_SOLDIER_SHOTGUN_6, MZ2_SOLDIER_SHOTGUN_7, MZ2_SOLDIER_SHOTGUN_8}; -static int machinegun_flash [] = {MZ2_SOLDIER_MACHINEGUN_1, MZ2_SOLDIER_MACHINEGUN_2, MZ2_SOLDIER_MACHINEGUN_3, MZ2_SOLDIER_MACHINEGUN_4, MZ2_SOLDIER_MACHINEGUN_5, MZ2_SOLDIER_MACHINEGUN_6, MZ2_SOLDIER_MACHINEGUN_7, MZ2_SOLDIER_MACHINEGUN_8}; +static const byte blaster_flash [] = { + MZ2_SOLDIER_BLASTER_1, + MZ2_SOLDIER_BLASTER_2, + MZ2_SOLDIER_BLASTER_3, + MZ2_SOLDIER_BLASTER_4, + MZ2_SOLDIER_BLASTER_5, + MZ2_SOLDIER_BLASTER_6, + MZ2_SOLDIER_BLASTER_7, + MZ2_SOLDIER_BLASTER_8 +}; + +static const byte shotgun_flash [] = { + MZ2_SOLDIER_SHOTGUN_1, + MZ2_SOLDIER_SHOTGUN_2, + MZ2_SOLDIER_SHOTGUN_3, + MZ2_SOLDIER_SHOTGUN_4, + MZ2_SOLDIER_SHOTGUN_5, + MZ2_SOLDIER_SHOTGUN_6, + MZ2_SOLDIER_SHOTGUN_7, + MZ2_SOLDIER_SHOTGUN_8 +}; + +static const byte machinegun_flash [] = { + MZ2_SOLDIER_MACHINEGUN_1, + MZ2_SOLDIER_MACHINEGUN_2, + MZ2_SOLDIER_MACHINEGUN_3, + MZ2_SOLDIER_MACHINEGUN_4, + MZ2_SOLDIER_MACHINEGUN_5, + MZ2_SOLDIER_MACHINEGUN_6, + MZ2_SOLDIER_MACHINEGUN_7, + MZ2_SOLDIER_MACHINEGUN_8 +}; void soldier_fire(edict_t *self, int flash_number) { diff --git a/src/baseq2/p_view.c b/src/baseq2/p_view.c index 6f3823b04..0595c2141 100644 --- a/src/baseq2/p_view.c +++ b/src/baseq2/p_view.c @@ -73,9 +73,9 @@ void P_DamageFeedback(edict_t *player) float realcount, count, kick; vec3_t v; int r, l; - static vec3_t power_color = {0, 1, 0}; - static vec3_t acolor = {1, 1, 1}; - static vec3_t bcolor = {1, 0, 0}; + static const vec3_t power_color = {0, 1, 0}; + static const vec3_t acolor = {1, 1, 1}; + static const vec3_t bcolor = {1, 0, 0}; client = player->client; From bb58e4f55eb0f3399650cf4eba9fdde5efb87e65 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 17 Aug 2023 22:27:25 +0300 Subject: [PATCH 12/15] Fix some whitespace issues in game code. --- src/baseq2/g_ai.c | 17 -- src/baseq2/g_chase.c | 2 +- src/baseq2/g_cmds.c | 31 ++-- src/baseq2/g_combat.c | 8 +- src/baseq2/g_func.c | 29 +-- src/baseq2/g_items.c | 19 +- src/baseq2/g_local.h | 23 --- src/baseq2/g_main.c | 19 +- src/baseq2/g_misc.c | 33 +--- src/baseq2/g_monster.c | 19 -- src/baseq2/g_phys.c | 31 ++-- src/baseq2/g_save.c | 6 +- src/baseq2/g_spawn.c | 372 +++++++++++++++++++-------------------- src/baseq2/g_svcmds.c | 18 +- src/baseq2/g_target.c | 7 - src/baseq2/g_trigger.c | 14 -- src/baseq2/g_turret.c | 4 - src/baseq2/g_utils.c | 43 ++--- src/baseq2/g_weapon.c | 12 -- src/baseq2/m_actor.c | 32 ++-- src/baseq2/m_berserk.c | 40 ++--- src/baseq2/m_boss2.c | 29 ++- src/baseq2/m_boss31.c | 31 ++-- src/baseq2/m_boss32.c | 27 +-- src/baseq2/m_brain.c | 41 ++--- src/baseq2/m_chick.c | 44 ++--- src/baseq2/m_flipper.c | 20 +-- src/baseq2/m_float.c | 31 ++-- src/baseq2/m_flyer.c | 47 ++--- src/baseq2/m_gladiator.c | 26 +-- src/baseq2/m_gunner.c | 35 ++-- src/baseq2/m_hover.c | 39 ++-- src/baseq2/m_infantry.c | 35 ++-- src/baseq2/m_insane.c | 38 ++-- src/baseq2/m_medic.c | 33 ++-- src/baseq2/m_move.c | 24 +-- src/baseq2/m_mutant.c | 35 ++-- src/baseq2/m_parasite.c | 37 ++-- src/baseq2/m_soldier.c | 62 +++---- src/baseq2/m_supertank.c | 29 +-- src/baseq2/m_tank.c | 49 ++---- src/baseq2/p_client.c | 40 +---- src/baseq2/p_hud.c | 20 +-- src/baseq2/p_trail.c | 6 - src/baseq2/p_view.c | 23 +-- src/baseq2/p_weapon.c | 31 +--- 46 files changed, 547 insertions(+), 1064 deletions(-) diff --git a/src/baseq2/g_ai.c b/src/baseq2/g_ai.c index 2a1beddb6..bfda9c967 100644 --- a/src/baseq2/g_ai.c +++ b/src/baseq2/g_ai.c @@ -30,7 +30,6 @@ float enemy_yaw; //============================================================================ - /* ================= AI_SetSightClient @@ -88,7 +87,6 @@ void ai_move(edict_t *self, float dist) M_walkmove(self, self->s.angles[YAW], dist); } - /* ============= ai_stand @@ -137,7 +135,6 @@ void ai_stand(edict_t *self, float dist) } } - /* ============= ai_walk @@ -163,7 +160,6 @@ void ai_walk(edict_t *self, float dist) } } - /* ============= ai_charge @@ -184,7 +180,6 @@ void ai_charge(edict_t *self, float dist) M_walkmove(self, self->s.angles[YAW], dist); } - /* ============= ai_turn @@ -204,7 +199,6 @@ void ai_turn(edict_t *self, float dist) M_ChangeYaw(self); } - /* .enemy @@ -282,7 +276,6 @@ bool visible(edict_t *self, edict_t *other) return false; } - /* ============= infront @@ -306,7 +299,6 @@ bool infront(edict_t *self, edict_t *other) return false; } - //============================================================================ void HuntTarget(edict_t *self) @@ -364,7 +356,6 @@ void FoundTarget(edict_t *self) self->monsterinfo.run(self); } - /* =========== FindTarget @@ -528,7 +519,6 @@ bool FindTarget(edict_t *self) return true; } - //============================================================================= /* @@ -547,7 +537,6 @@ bool FacingIdeal(edict_t *self) return true; } - //============================================================================= bool M_CheckAttack(edict_t *self) @@ -625,7 +614,6 @@ bool M_CheckAttack(edict_t *self) return false; } - /* ============= ai_run_melee @@ -644,7 +632,6 @@ void ai_run_melee(edict_t *self) } } - /* ============= ai_run_missile @@ -663,7 +650,6 @@ void ai_run_missile(edict_t *self) } } - /* ============= ai_run_slide @@ -690,7 +676,6 @@ void ai_run_slide(edict_t *self, float distance) M_walkmove(self, self->ideal_yaw - ofs, distance); } - /* ============= ai_checkattack @@ -791,7 +776,6 @@ bool ai_checkattack(edict_t *self, float dist) VectorSubtract(self->enemy->s.origin, self->s.origin, temp); enemy_yaw = vectoyaw(temp); - // JDC self->ideal_yaw = enemy_yaw; if (self->monsterinfo.attack_state == AS_MISSILE) { @@ -810,7 +794,6 @@ bool ai_checkattack(edict_t *self, float dist) return self->monsterinfo.checkattack(self); } - /* ============= ai_run diff --git a/src/baseq2/g_chase.c b/src/baseq2/g_chase.c index f9b18cce7..4ffc714cd 100644 --- a/src/baseq2/g_chase.c +++ b/src/baseq2/g_chase.c @@ -87,7 +87,7 @@ void UpdateChaseCam(edict_t *ent) ent->client->ps.pmove.pm_type = PM_FREEZE; VectorCopy(goal, ent->s.origin); - for (i = 0 ; i < 3 ; i++) + for (i = 0; i < 3; i++) ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(targ->client->v_angle[i] - ent->client->resp.cmd_angles[i]); if (targ->deadflag) { diff --git a/src/baseq2/g_cmds.c b/src/baseq2/g_cmds.c index 6f111eeee..1c4d244ed 100644 --- a/src/baseq2/g_cmds.c +++ b/src/baseq2/g_cmds.c @@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "g_local.h" #include "m_player.h" - char *ClientTeam(edict_t *ent) { char *p; @@ -59,7 +58,6 @@ bool OnSameTeam(edict_t *ent1, edict_t *ent2) return false; } - void SelectNextItem(edict_t *ent, int itflags) { gclient_t *cl; @@ -74,7 +72,7 @@ void SelectNextItem(edict_t *ent, int itflags) } // scan for the next valid one - for (i = 1 ; i <= MAX_ITEMS ; i++) { + for (i = 1; i <= MAX_ITEMS; i++) { index = (cl->pers.selected_item + i) % MAX_ITEMS; if (!cl->pers.inventory[index]) continue; @@ -105,7 +103,7 @@ void SelectPrevItem(edict_t *ent, int itflags) } // scan for the next valid one - for (i = 1 ; i <= MAX_ITEMS ; i++) { + for (i = 1; i <= MAX_ITEMS; i++) { index = (cl->pers.selected_item + MAX_ITEMS - i) % MAX_ITEMS; if (!cl->pers.inventory[index]) continue; @@ -134,7 +132,6 @@ void ValidateSelectedItem(edict_t *ent) SelectNextItem(ent, -1); } - //================================================================================= /* @@ -175,7 +172,7 @@ void Cmd_Give_f(edict_t *ent) } if (give_all || Q_stricmp(name, "weapons") == 0) { - for (i = 0 ; i < game.num_items ; i++) { + for (i = 0; i < game.num_items; i++) { it = itemlist + i; if (!it->pickup) continue; @@ -188,7 +185,7 @@ void Cmd_Give_f(edict_t *ent) } if (give_all || Q_stricmp(name, "ammo") == 0) { - for (i = 0 ; i < game.num_items ; i++) { + for (i = 0; i < game.num_items; i++) { it = itemlist + i; if (!it->pickup) continue; @@ -231,7 +228,7 @@ void Cmd_Give_f(edict_t *ent) } if (give_all) { - for (i = 0 ; i < game.num_items ; i++) { + for (i = 0; i < game.num_items; i++) { it = itemlist + i; if (!it->pickup) continue; @@ -274,7 +271,6 @@ void Cmd_Give_f(edict_t *ent) } } - /* ================== Cmd_God_f @@ -298,7 +294,6 @@ void Cmd_God_f(edict_t *ent) gi.cprintf(ent, PRINT_HIGH, "godmode ON\n"); } - /* ================== Cmd_Notarget_f @@ -322,7 +317,6 @@ void Cmd_Notarget_f(edict_t *ent) gi.cprintf(ent, PRINT_HIGH, "notarget ON\n"); } - /* ================== Cmd_Noclip_f @@ -346,7 +340,6 @@ void Cmd_Noclip_f(edict_t *ent) } } - /* ================== Cmd_Use_f @@ -379,7 +372,6 @@ void Cmd_Use_f(edict_t *ent) it->use(ent, it); } - /* ================== Cmd_Drop_f @@ -412,7 +404,6 @@ void Cmd_Drop_f(edict_t *ent) it->drop(ent, it); } - /* ================= Cmd_Inven_f @@ -436,7 +427,7 @@ void Cmd_Inven_f(edict_t *ent) cl->showinventory = true; gi.WriteByte(svc_inventory); - for (i = 0 ; i < MAX_ITEMS ; i++) { + for (i = 0; i < MAX_ITEMS; i++) { gi.WriteShort(cl->pers.inventory[i]); } gi.unicast(ent, true); @@ -486,7 +477,7 @@ void Cmd_WeapPrev_f(edict_t *ent) selected_weapon = ITEM_INDEX(cl->pers.weapon); // scan for the next valid one - for (i = 1 ; i <= MAX_ITEMS ; i++) { + for (i = 1; i <= MAX_ITEMS; i++) { index = (selected_weapon + i) % MAX_ITEMS; if (!cl->pers.inventory[index]) continue; @@ -521,7 +512,7 @@ void Cmd_WeapNext_f(edict_t *ent) selected_weapon = ITEM_INDEX(cl->pers.weapon); // scan for the next valid one - for (i = 1 ; i <= MAX_ITEMS ; i++) { + for (i = 1; i <= MAX_ITEMS; i++) { index = (selected_weapon + MAX_ITEMS - i) % MAX_ITEMS; if (!cl->pers.inventory[index]) continue; @@ -614,7 +605,6 @@ void Cmd_PutAway_f(edict_t *ent) ent->client->showinventory = false; } - int PlayerSort(void const *a, void const *b) { int anum, bnum; @@ -646,7 +636,7 @@ void Cmd_Players_f(edict_t *ent) int index[256]; count = 0; - for (i = 0 ; i < maxclients->value ; i++) + for (i = 0; i < maxclients->value; i++) if (game.clients[i].pers.connected) { index[count] = i; count++; @@ -658,7 +648,7 @@ void Cmd_Players_f(edict_t *ent) // print information large[0] = 0; - for (i = 0 ; i < count ; i++) { + for (i = 0; i < count; i++) { Q_snprintf(small, sizeof(small), "%3i %s\n", game.clients[index[i]].ps.stats[STAT_FRAGS], game.clients[index[i]].pers.netname); @@ -840,7 +830,6 @@ void Cmd_PlayerList_f(edict_t *ent) gi.cprintf(ent, PRINT_HIGH, "%s", text); } - /* ================= ClientCommand diff --git a/src/baseq2/g_combat.c b/src/baseq2/g_combat.c index d4a19a4a7..916f621ad 100644 --- a/src/baseq2/g_combat.c +++ b/src/baseq2/g_combat.c @@ -76,11 +76,9 @@ bool CanDamage(edict_t *targ, edict_t *inflictor) if (trace.fraction == 1.0f) return true; - return false; } - /* ============ Killed @@ -119,7 +117,6 @@ void Killed(edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, ve targ->die(targ, inflictor, attacker, damage, point); } - /* ================ SpawnDamage @@ -137,7 +134,6 @@ void SpawnDamage(int type, const vec3_t origin, const vec3_t normal, int damage) gi.multicast(origin, MULTICAST_PVS); } - /* ============ T_Damage @@ -419,7 +415,7 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, const vec3_t VectorNormalize2(dir, kvel); - if (targ->client && attacker == targ) + if (targ->client && attacker == targ) VectorScale(kvel, 1600.0f * (float)knockback / mass, kvel); // the rocket jump hack... else VectorScale(kvel, 500.0f * (float)knockback / mass, kvel); @@ -471,7 +467,6 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, const vec3_t else SpawnDamage(te_sparks, point, normal, take); - targ->health = targ->health - take; if (targ->health <= 0) { @@ -510,7 +505,6 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, const vec3_t } } - /* ============ T_RadiusDamage diff --git a/src/baseq2/g_func.c b/src/baseq2/g_func.c index a2e34c676..0ae8f63b5 100644 --- a/src/baseq2/g_func.c +++ b/src/baseq2/g_func.c @@ -47,7 +47,6 @@ with this program; if not, write to the Free Software Foundation, Inc., disabled? auto trigger spawning - ========================================================= */ @@ -66,7 +65,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #define DOOR_X_AXIS 64 #define DOOR_Y_AXIS 128 - // // Support routines for movement (changes in origin using velocity) // @@ -129,7 +127,6 @@ void Move_Calc(edict_t *ent, const vec3_t dest, void(*func)(edict_t*)) } } - // // Support routines for angular movement (changes in angle using avelocity) // @@ -206,7 +203,6 @@ void AngleMove_Calc(edict_t *ent, void(*func)(edict_t*)) } } - /* ============== Think_AccelMove @@ -329,7 +325,6 @@ void Think_AccelMove(edict_t *ent) ent->think = Think_AccelMove; } - void plat_go_down(edict_t *ent); void plat_hit_top(edict_t *ent) @@ -396,7 +391,6 @@ void plat_blocked(edict_t *self, edict_t *other) plat_go_up(self); } - void Use_Plat(edict_t *ent, edict_t *other, edict_t *activator) { if (ent->think) @@ -404,7 +398,6 @@ void Use_Plat(edict_t *ent, edict_t *other, edict_t *activator) plat_go_down(ent); } - void Touch_Plat_Center(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { if (!other->client) @@ -462,7 +455,6 @@ void plat_spawn_inside_trigger(edict_t *ent) gi.linkentity(trigger); } - /*QUAKED func_plat (0 .5 .8) ? PLAT_LOW_TRIGGER speed default 150 @@ -909,7 +901,7 @@ void door_use(edict_t *self, edict_t *other, edict_t *activator) if (self->spawnflags & DOOR_TOGGLE) { if (self->moveinfo.state == STATE_UP || self->moveinfo.state == STATE_TOP) { // trigger all paired doors - for (ent = self ; ent ; ent = ent->teamchain) { + for (ent = self; ent; ent = ent->teamchain) { ent->message = NULL; ent->touch = NULL; door_go_down(ent); @@ -919,7 +911,7 @@ void door_use(edict_t *self, edict_t *other, edict_t *activator) } // trigger all paired doors - for (ent = self ; ent ; ent = ent->teamchain) { + for (ent = self; ent; ent = ent->teamchain) { ent->message = NULL; ent->touch = NULL; door_go_up(ent, activator); @@ -993,7 +985,7 @@ void Think_SpawnDoorTrigger(edict_t *ent) VectorCopy(ent->absmin, mins); VectorCopy(ent->absmax, maxs); - for (other = ent->teamchain ; other ; other = other->teamchain) { + for (other = ent->teamchain; other; other = other->teamchain) { AddPointToBounds(other->absmin, mins, maxs); AddPointToBounds(other->absmax, mins, maxs); } @@ -1037,15 +1029,14 @@ void door_blocked(edict_t *self, edict_t *other) if (self->spawnflags & DOOR_CRUSHER) return; - // if a door has a negative wait, it would never come back if blocked, // so let it just squash the object to death real fast if (self->moveinfo.wait >= 0) { if (self->moveinfo.state == STATE_DOWN) { - for (ent = self->teammaster ; ent ; ent = ent->teamchain) + for (ent = self->teammaster; ent; ent = ent->teamchain) door_go_up(ent, ent->activator); } else { - for (ent = self->teammaster ; ent ; ent = ent->teamchain) + for (ent = self->teammaster; ent; ent = ent->teamchain) door_go_down(ent); } } @@ -1055,7 +1046,7 @@ void door_killed(edict_t *self, edict_t *inflictor, edict_t *attacker, int damag { edict_t *ent; - for (ent = self->teammaster ; ent ; ent = ent->teamchain) { + for (ent = self->teammaster; ent; ent = ent->teamchain) { ent->health = ent->max_health; ent->takedamage = DAMAGE_NO; } @@ -1163,7 +1154,6 @@ void SP_func_door(edict_t *ent) ent->think = Think_SpawnDoorTrigger; } - /*QUAKED func_door_rotating (0 .5 .8) ? START_OPEN REVERSE CRUSHER NOMONSTER ANIMATED TOGGLE X_AXIS Y_AXIS TOGGLE causes the door to wait in both the start and end states for a trigger event. @@ -1289,7 +1279,6 @@ void SP_func_door_rotating(edict_t *ent) ent->think = Think_SpawnDoorTrigger; } - /*QUAKED func_water (0 .5 .8) ? START_OPEN func_water is a moveable water brush. It must be targeted to operate. Use a non-water texture at your own risk. @@ -1369,7 +1358,6 @@ void SP_func_water(edict_t *self) gi.linkentity(self); } - #define TRAIN_START_ON 1 #define TRAIN_TOGGLE 2 #define TRAIN_BLOCK_STOPS 4 @@ -1597,7 +1585,6 @@ void SP_func_train(edict_t *self) } } - /*QUAKED trigger_elevator (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) */ void trigger_elevator_use(edict_t *self, edict_t *other, edict_t *activator) @@ -1651,7 +1638,6 @@ void SP_trigger_elevator(edict_t *self) self->nextthink = level.framenum + 1; } - /*QUAKED func_timer (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) START_ON "wait" base time between triggering all targets, default is 1 "random" wait variance, default is 0 @@ -1710,7 +1696,6 @@ void SP_func_timer(edict_t *self) self->svflags = SVF_NOCLIENT; } - /*QUAKED func_conveyor (0 .5 .8) ? START_ON TOGGLE Conveyors are stationary brushes that move what's on them. The brush should be have a surface with at least one current content enabled. @@ -1748,7 +1733,6 @@ void SP_func_conveyor(edict_t *self) gi.linkentity(self); } - /*QUAKED func_door_secret (0 .5 .8) ? always_shoot 1st_left 1st_down A secret door. Slide back and then to the side. @@ -1915,7 +1899,6 @@ void SP_func_door_secret(edict_t *ent) gi.linkentity(ent); } - /*QUAKED func_killbox (1 0 0) ? Kills everything inside when fired, irrespective of protection. */ diff --git a/src/baseq2/g_items.c b/src/baseq2/g_items.c index 54e1dfceb..57a970939 100644 --- a/src/baseq2/g_items.c +++ b/src/baseq2/g_items.c @@ -17,7 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "g_local.h" - bool Pickup_Weapon(edict_t *ent, edict_t *other); void Use_Weapon(edict_t *ent, const gitem_t *inv); void Drop_Weapon(edict_t *ent, const gitem_t *inv); @@ -66,7 +65,6 @@ const gitem_t *GetItemByIndex(int index) return &itemlist[index]; } - /* =============== FindItemByClassname @@ -79,7 +77,7 @@ const gitem_t *FindItemByClassname(const char *classname) const gitem_t *it; it = itemlist; - for (i = 0 ; i < game.num_items ; i++, it++) { + for (i = 0; i < game.num_items; i++, it++) { if (!it->classname) continue; if (!Q_stricmp(it->classname, classname)) @@ -101,7 +99,7 @@ const gitem_t *FindItem(const char *pickup_name) const gitem_t *it; it = itemlist; - for (i = 0 ; i < game.num_items ; i++, it++) { + for (i = 0; i < game.num_items; i++, it++) { if (!it->pickup_name) continue; if (!Q_stricmp(it->pickup_name, pickup_name)) @@ -149,7 +147,6 @@ void SetRespawn(edict_t *ent, float delay) gi.linkentity(ent); } - //====================================================================== bool Pickup_Powerup(edict_t *ent, edict_t *other) @@ -185,7 +182,6 @@ void Drop_General(edict_t *ent, const gitem_t *item) ValidateSelectedItem(ent); } - //====================================================================== bool Pickup_Adrenaline(edict_t *ent, edict_t *other) @@ -513,7 +509,6 @@ void Drop_Ammo(edict_t *ent, const gitem_t *item) ValidateSelectedItem(ent); } - //====================================================================== void MegaHealth_think(edict_t *self) @@ -921,7 +916,6 @@ void droptofloor(edict_t *ent) gi.linkentity(ent); } - /* =============== PrecacheItem @@ -1116,7 +1110,6 @@ const gitem_t itemlist[] = { .tag = ARMOR_SHARD, }, - /*QUAKED item_power_screen (.3 .3 1) (-16 -16 -16) (16 16 16) */ { @@ -1159,7 +1152,6 @@ const gitem_t itemlist[] = { }, }, - // // WEAPONS // @@ -1565,7 +1557,6 @@ const gitem_t itemlist[] = { .tag = AMMO_SLUGS, }, - // // POWERUP ITEMS // @@ -1898,7 +1889,6 @@ const gitem_t itemlist[] = { { NULL } }; - /*QUAKED item_health (.3 .3 1) (-16 -16 -16) (16 16 16) */ void SP_item_health(edict_t *self) @@ -1961,14 +1951,11 @@ void SP_item_health_mega(edict_t *self) self->style = HEALTH_IGNORE_MAX | HEALTH_TIMED; } - void InitItems(void) { game.num_items = sizeof(itemlist) / sizeof(itemlist[0]) - 1; } - - /* =============== SetItemNames @@ -1981,7 +1968,7 @@ void SetItemNames(void) int i; const gitem_t *it; - for (i = 0 ; i < game.num_items ; i++) { + for (i = 0; i < game.num_items; i++) { it = &itemlist[i]; gi.configstring(CS_ITEMS + i, it->pickup_name); } diff --git a/src/baseq2/g_local.h b/src/baseq2/g_local.h index c227b8298..b251acbb3 100644 --- a/src/baseq2/g_local.h +++ b/src/baseq2/g_local.h @@ -46,7 +46,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #define DAMAGE_TIME 0.5f #define FALL_TIME 0.3f - // edict->spawnflags // these are set with checkboxes on each entity in the map editor #define SPAWNFLAG_NOT_EASY 0x00000100 @@ -71,14 +70,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #define FL_POWER_ARMOR 0x00001000 // power armor (if any) is active #define FL_RESPAWN 0x80000000 // used for item respawning - #define FRAMETIME 0.1f // memory tags to allow dynamic memory to be cleaned up #define TAG_GAME 765 // clear when unloading the dll #define TAG_LEVEL 766 // clear when loading a new level - #define MELEE_DISTANCE 80 #define BODY_QUEUE_SIZE 8 @@ -105,7 +102,6 @@ typedef enum { AMMO_SLUGS } ammo_t; - //deadflag #define DEAD_NO 0 #define DEAD_DYING 1 @@ -162,7 +158,6 @@ typedef enum { #define LEFT_HANDED 1 #define CENTER_HANDED 2 - // game.serverflags values #define SFL_CROSS_TRIGGER_1 0x00000001 #define SFL_CROSS_TRIGGER_2 0x00000002 @@ -174,13 +169,11 @@ typedef enum { #define SFL_CROSS_TRIGGER_8 0x00000080 #define SFL_CROSS_TRIGGER_MASK 0x000000ff - // noise types for PlayerNoise #define PNOISE_SELF 0 #define PNOISE_WEAPON 1 #define PNOISE_IMPACT 2 - // edict->movetype values typedef enum { MOVETYPE_NONE, // never moves @@ -196,8 +189,6 @@ typedef enum { MOVETYPE_BOUNCE } movetype_t; - - typedef struct { int base_count; int max_count; @@ -206,7 +197,6 @@ typedef struct { int armor; } gitem_armor_t; - // gitem_t->flags #define IT_WEAPON 1 // use makes active weapon #define IT_AMMO 2 @@ -257,8 +247,6 @@ typedef struct gitem_s { const char *const *precaches; // array of all models, sounds, and images this item will use } gitem_t; - - // // this structure is left intact through an entire game // it should be initialized at dll load time, and read/written to @@ -289,7 +277,6 @@ typedef struct { bool autosaved; } game_locals_t; - // // this structure is cleared as each map is entered // it is read/written to the level.sav file for savegames @@ -335,7 +322,6 @@ typedef struct { int power_cubes; // ugly necessity for coop } level_locals_t; - // spawn_temp_t is only used to hold entity field values that // can be set from the editor, but aren't actualy present // in edict_t during gameplay @@ -362,7 +348,6 @@ typedef struct { float maxpitch; } spawn_temp_t; - typedef struct { // fixed data vec3_t start_origin; @@ -392,7 +377,6 @@ typedef struct { void (*endfunc)(edict_t *); } moveinfo_t; - typedef struct { void (*aifunc)(edict_t *self, float dist); float dist; @@ -439,8 +423,6 @@ typedef struct { int power_armor_power; } monsterinfo_t; - - extern game_locals_t game; extern level_locals_t level; extern game_import_t gi; @@ -454,7 +436,6 @@ extern int snd_fry; //extern int combat_armor_index; //extern int body_armor_index; - // means of death #define MOD_UNKNOWN 0 #define MOD_BLASTER 1 @@ -494,7 +475,6 @@ extern int snd_fry; extern int meansOfDeath; - extern edict_t *g_edicts; #define FOFS(x) q_offsetof(edict_t, x) @@ -819,7 +799,6 @@ void GetChaseTarget(edict_t *ent); #define ANIM_DEATH 5 #define ANIM_REVERSE 6 - // client data that stays across multiple level loads typedef struct { char userinfo[MAX_INFO_STRING]; @@ -954,7 +933,6 @@ struct gclient_s { bool update_chase; // need to update chase info? }; - struct edict_s { entity_state_t s; struct gclient_s *client; // NULL if not a player @@ -982,7 +960,6 @@ struct edict_s { int clipmask; edict_t *owner; - // DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER // EXPECTS THE FIELDS IN THAT ORDER! diff --git a/src/baseq2/g_main.c b/src/baseq2/g_main.c index c1491aff4..bd779496c 100644 --- a/src/baseq2/g_main.c +++ b/src/baseq2/g_main.c @@ -91,10 +91,8 @@ void ReadLevel(const char *filename); void InitGame(void); void G_RunFrame(void); - //=================================================================== - void ShutdownGame(void) { gi.dprintf("==== ShutdownGame ====\n"); @@ -160,7 +158,7 @@ void InitGame(void) run_pitch = gi.cvar("run_pitch", "0.002", 0); run_roll = gi.cvar("run_roll", "0.005", 0); - bob_up = gi.cvar("bob_up", "0.005", 0); + bob_up = gi.cvar("bob_up", "0.005", 0); bob_pitch = gi.cvar("bob_pitch", "0.002", 0); bob_roll = gi.cvar("bob_roll", "0.002", 0); @@ -203,7 +201,6 @@ void InitGame(void) globals.num_edicts = game.maxclients + 1; } - /* ================= GetGameAPI @@ -275,7 +272,6 @@ void Com_Error(error_type_t type, const char *fmt, ...) //====================================================================== - /* ================= ClientEndServerFrames @@ -288,13 +284,12 @@ void ClientEndServerFrames(void) // calc the player views now that all pushing // and damage has been added - for (i = 0 ; i < maxclients->value ; i++) { + for (i = 0; i < maxclients->value; i++) { ent = g_edicts + 1 + i; if (!ent->inuse || !ent->client) continue; ClientEndServerFrame(ent); } - } /* @@ -375,7 +370,6 @@ void EndDMLevel(void) } } - /* ================= CheckNeedPass @@ -426,7 +420,7 @@ void CheckDMRules(void) } if (fraglimit->value) { - for (i = 0 ; i < maxclients->value ; i++) { + for (i = 0; i < maxclients->value; i++) { cl = game.clients + i; if (!g_edicts[i + 1].inuse) continue; @@ -440,7 +434,6 @@ void CheckDMRules(void) } } - /* ============= ExitLevel @@ -450,7 +443,7 @@ void ExitLevel(void) { int i; edict_t *ent; - char command [256]; + char command[256]; Q_snprintf(command, sizeof(command), "gamemap \"%s\"\n", level.changemap); gi.AddCommandString(command); @@ -459,7 +452,7 @@ void ExitLevel(void) level.intermission_framenum = 0; // clear some things before going to next level - for (i = 0 ; i < maxclients->value ; i++) { + for (i = 0; i < maxclients->value; i++) { ent = g_edicts + 1 + i; if (!ent->inuse) continue; @@ -498,7 +491,7 @@ void G_RunFrame(void) // even the world gets a chance to think // ent = &g_edicts[0]; - for (i = 0 ; i < globals.num_edicts ; i++, ent++) { + for (i = 0; i < globals.num_edicts; i++, ent++) { if (!ent->inuse) continue; diff --git a/src/baseq2/g_misc.c b/src/baseq2/g_misc.c index 0a6543091..51d96254f 100644 --- a/src/baseq2/g_misc.c +++ b/src/baseq2/g_misc.c @@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "g_local.h" - /*QUAKED func_group (0 0 0) ? Used to group brushes together just for editor convenience. */ @@ -47,7 +46,6 @@ void SP_func_areaportal(edict_t *ent) //===================================================== - /* ================= Misc functions @@ -72,7 +70,6 @@ void ClipGibVelocity(edict_t *ent) clamp(ent->velocity[2], 200, 500); // always some upwards } - /* ================= gibs @@ -203,7 +200,6 @@ void ThrowHead(edict_t *self, char *gibname, int damage, int type) gi.linkentity(self); } - void ThrowClientHead(edict_t *self, int damage) { vec3_t vd; @@ -244,7 +240,6 @@ void ThrowClientHead(edict_t *self, int damage) gi.linkentity(self); } - /* ================= debris @@ -282,7 +277,6 @@ void ThrowDebris(edict_t *self, char *modelname, float speed, vec3_t origin) gi.linkentity(chunk); } - void BecomeExplosion1(edict_t *self) { gi.WriteByte(svc_temp_entity); @@ -293,7 +287,6 @@ void BecomeExplosion1(edict_t *self) G_FreeEdict(self); } - void BecomeExplosion2(edict_t *self) { gi.WriteByte(svc_temp_entity); @@ -304,7 +297,6 @@ void BecomeExplosion2(edict_t *self) G_FreeEdict(self); } - /*QUAKED path_corner (.5 .3 0) (-8 -8 -8) (8 8 8) TELEPORT Target: next path corner Pathtarget: gets used when an entity that has @@ -378,7 +370,6 @@ void SP_path_corner(edict_t *self) gi.linkentity(self); } - /*QUAKED point_combat (0.5 0.3 0) (-8 -8 -8) (8 8 8) Hold Makes this the target of a monster and it will head here when first activated before going after the activator. If @@ -444,7 +435,6 @@ void SP_point_combat(edict_t *self) gi.linkentity(self); } - /*QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8) Just for the debugging level. Don't use */ @@ -470,7 +460,6 @@ void SP_viewthing(edict_t *ent) return; } - /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4) Used as a positional target for spotlights, etc. */ @@ -479,7 +468,6 @@ void SP_info_null(edict_t *self) G_FreeEdict(self); } - /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) Used as a positional target for lightning. */ @@ -489,7 +477,6 @@ void SP_info_notnull(edict_t *self) VectorCopy(self->s.origin, self->absmax); } - /*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF Non-displayed light. Default light value is 300. @@ -528,7 +515,6 @@ void SP_light(edict_t *self) } } - /*QUAKED func_wall (0 .5 .8) ? TRIGGER_SPAWN TOGGLE START_ON ANIMATED ANIMATED_FAST This is just a solid wall if not inhibited @@ -600,7 +586,6 @@ void SP_func_wall(edict_t *self) gi.linkentity(self); } - /*QUAKED func_object (0 .5 .8) ? TRIGGER_SPAWN ANIMATED ANIMATED_FAST This is solid bmodel that will fall if it's support it removed. */ @@ -668,7 +653,6 @@ void SP_func_object(edict_t *self) gi.linkentity(self); } - /*QUAKED func_explosive (0 .5 .8) ? Trigger_Spawn ANIMATED ANIMATED_FAST Any brush that you want to explode or break apart. If you want an ex0plosion, set dmg and it will do a radius explosion of that amount @@ -793,7 +777,6 @@ void SP_func_explosive(edict_t *self) gi.linkentity(self); } - /*QUAKED misc_explobox (0 .5 .8) (-16 -16 0) (16 16 40) Large exploding box. You can override its mass (100), health (80), and dmg (150). @@ -908,7 +891,6 @@ void SP_misc_explobox(edict_t *self) gi.linkentity(self); } - // // miscellaneous specialty items // @@ -980,7 +962,6 @@ void SP_misc_eastertank(edict_t *ent) /*QUAKED misc_easterchick (1 .5 0) (-32 -32 0) (32 32 32) */ - void misc_easterchick_think(edict_t *self) { if (++self->s.frame < 247) @@ -1007,7 +988,6 @@ void SP_misc_easterchick(edict_t *ent) /*QUAKED misc_easterchick2 (1 .5 0) (-32 -32 0) (32 32 32) */ - void misc_easterchick2_think(edict_t *self) { if (++self->s.frame < 287) @@ -1031,7 +1011,6 @@ void SP_misc_easterchick2(edict_t *ent) gi.linkentity(ent); } - /*QUAKED monster_commander_body (1 .5 0) (-32 -32 0) (32 32 48) Not really a monster, this is the Tank Commander's decapitated body. There should be a item_commander_head that has this as it's target. @@ -1082,7 +1061,6 @@ void SP_monster_commander_body(edict_t *self) self->nextthink = level.framenum + 5; } - /*QUAKED misc_banner (1 .5 0) (-4 -4 -4) (4 4 4) The origin is the bottom of the banner. The banner is 128 tall. @@ -1203,7 +1181,6 @@ void SP_misc_viper(edict_t *ent) gi.linkentity(ent); } - /*QUAKED misc_bigviper (1 .5 0) (-176 -120 -24) (176 120 72) This is a large stationary viper as seen in Paul's intro */ @@ -1217,7 +1194,6 @@ void SP_misc_bigviper(edict_t *ent) gi.linkentity(ent); } - /*QUAKED misc_viper_bomb (1 0 0) (-8 -8 -8) (8 8 8) "dmg" how much boom should the bomb make? */ @@ -1288,7 +1264,6 @@ void SP_misc_viper_bomb(edict_t *self) gi.linkentity(self); } - /*QUAKED misc_strogg_ship (1 .5 0) (-16 -16 0) (16 16 32) This is a Storgg ship for the flybys. It is trigger_spawned, so you must have something use it for it to show up. @@ -1333,7 +1308,6 @@ void SP_misc_strogg_ship(edict_t *ent) gi.linkentity(ent); } - /*QUAKED misc_satellite_dish (1 .5 0) (-64 -64 0) (64 64 128) */ void misc_satellite_dish_think(edict_t *self) @@ -1361,7 +1335,6 @@ void SP_misc_satellite_dish(edict_t *ent) gi.linkentity(ent); } - /*QUAKED light_mine1 (0 1 0) (-2 -2 -12) (2 2 12) */ void SP_light_mine1(edict_t *ent) @@ -1372,7 +1345,6 @@ void SP_light_mine1(edict_t *ent) gi.linkentity(ent); } - /*QUAKED light_mine2 (0 1 0) (-2 -2 -12) (2 2 12) */ void SP_light_mine2(edict_t *ent) @@ -1383,7 +1355,6 @@ void SP_light_mine2(edict_t *ent) gi.linkentity(ent); } - /*QUAKED misc_gib_arm (1 0 0) (-8 -8 -8) (8 8 8) Intended for use with the target_spawner */ @@ -1464,7 +1435,6 @@ void SP_target_character(edict_t *self) return; } - /*QUAKED target_string (0 0 1) (-8 -8 -8) (8 8 8) */ @@ -1503,7 +1473,6 @@ void SP_target_string(edict_t *self) self->use = target_string_use; } - /*QUAKED func_clock (0 0 1) (-8 -8 -8) (8 8 8) TIMER_UP TIMER_DOWN START_OFF MULTI_USE target a target_string with this @@ -1684,7 +1653,7 @@ void teleporter_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t other->s.event = EV_PLAYER_TELEPORT; // set angles - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { other->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(dest->s.angles[i] - other->client->resp.cmd_angles[i]); } diff --git a/src/baseq2/g_monster.c b/src/baseq2/g_monster.c index ff5724e2c..42d1503cc 100644 --- a/src/baseq2/g_monster.c +++ b/src/baseq2/g_monster.c @@ -17,7 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "g_local.h" - // // monster weapons // @@ -96,8 +95,6 @@ void monster_fire_bfg(edict_t *self, vec3_t start, vec3_t aimdir, int damage, in gi.multicast(start, MULTICAST_PVS); } - - // // Monster utility functions // @@ -135,7 +132,6 @@ void AttackFinished(edict_t *self, float time) self->monsterinfo.attack_finished = level.framenum + time * BASE_FRAMERATE; } - void M_CheckGround(edict_t *ent) { vec3_t point; @@ -174,7 +170,6 @@ void M_CheckGround(edict_t *ent) } } - void M_CatagorizePosition(edict_t *ent) { vec3_t point; @@ -208,7 +203,6 @@ void M_CatagorizePosition(edict_t *ent) ent->waterlevel = 3; } - void M_WorldEffects(edict_t *ent) { int dmg; @@ -282,7 +276,6 @@ void M_WorldEffects(edict_t *ent) } } - void M_droptofloor(edict_t *ent) { vec3_t end; @@ -304,7 +297,6 @@ void M_droptofloor(edict_t *ent) M_CatagorizePosition(ent); } - void M_SetEffects(edict_t *ent) { ent->s.effects &= ~(EF_COLOR_SHELL | EF_POWERSCREEN); @@ -328,7 +320,6 @@ void M_SetEffects(edict_t *ent) } } - void M_MoveFrame(edict_t *self) { const mmove_t *move; @@ -378,7 +369,6 @@ void M_MoveFrame(edict_t *self) move->frame[index].thinkfunc(self); } - void monster_think(edict_t *self) { M_MoveFrame(self); @@ -391,7 +381,6 @@ void monster_think(edict_t *self) M_SetEffects(self); } - /* ================ monster_use @@ -417,10 +406,8 @@ void monster_use(edict_t *self, edict_t *other, edict_t *activator) FoundTarget(self); } - void monster_start_go(edict_t *self); - void monster_triggered_spawn(edict_t *self) { self->s.origin[2] += 1; @@ -460,7 +447,6 @@ void monster_triggered_start(edict_t *self) self->use = monster_triggered_spawn_use; } - /* ================ monster_death_use @@ -488,7 +474,6 @@ void monster_death_use(edict_t *self) G_UseTargets(self, self->enemy); } - //============================================================================ bool monster_start(edict_t *self) @@ -607,7 +592,6 @@ void monster_start_go(edict_t *self) self->nextthink = level.framenum + 1; } - void walkmonster_start_go(edict_t *self) { if (!(self->spawnflags & 2) && level.time < 1) { @@ -634,7 +618,6 @@ void walkmonster_start(edict_t *self) monster_start(self); } - void flymonster_start_go(edict_t *self) { if (!M_walkmove(self, 0, 0)) @@ -650,7 +633,6 @@ void flymonster_start_go(edict_t *self) monster_triggered_start(self); } - void flymonster_start(edict_t *self) { self->flags |= FL_FLY; @@ -658,7 +640,6 @@ void flymonster_start(edict_t *self) monster_start(self); } - void swimmonster_start_go(edict_t *self) { if (!self->yaw_speed) diff --git a/src/baseq2/g_phys.c b/src/baseq2/g_phys.c index 428f376a1..af844aec8 100644 --- a/src/baseq2/g_phys.c +++ b/src/baseq2/g_phys.c @@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc., /* - pushmove objects do not obey gravity, and do not interact with each other or trigger fields, but block normal movement and push normal objects when they move. onground is set for toss objects when they come to a complete rest. it is set for steping or walking objects @@ -37,7 +36,6 @@ solid_edge items only clip against bsp models. */ - /* ============ SV_TestEntityPosition @@ -61,7 +59,6 @@ edict_t *SV_TestEntityPosition(edict_t *ent) return NULL; } - /* ================ SV_CheckVelocity @@ -124,7 +121,6 @@ void SV_Impact(edict_t *e1, trace_t *trace) e2->touch(e2, e1, NULL, NULL); } - /* ================== ClipVelocity @@ -149,7 +145,7 @@ int ClipVelocity(vec3_t in, vec3_t normal, vec3_t out, float overbounce) backoff = DotProduct(in, normal) * overbounce; - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { change = normal[i] * backoff; out[i] = in[i] - change; if (out[i] > -STOP_EPSILON && out[i] < STOP_EPSILON) @@ -159,7 +155,6 @@ int ClipVelocity(vec3_t in, vec3_t normal, vec3_t out, float overbounce) return blocked; } - /* ============ SV_FlyMove @@ -197,8 +192,8 @@ int SV_FlyMove(edict_t *ent, float time, int mask) time_left = time; ent->groundentity = NULL; - for (bumpcount = 0 ; bumpcount < numbumps ; bumpcount++) { - for (i = 0 ; i < 3 ; i++) + for (bumpcount = 0; bumpcount < numbumps; bumpcount++) { + for (i = 0; i < 3; i++) end[i] = ent->s.origin[i] + time_left * ent->velocity[i]; trace = gi.trace(ent->s.origin, ent->mins, ent->maxs, end, ent, mask); @@ -239,7 +234,6 @@ int SV_FlyMove(edict_t *ent, float time, int mask) if (!ent->inuse) break; // removed by the impact function - time_left -= time_left * trace.fraction; // cliped to another plane @@ -255,10 +249,10 @@ int SV_FlyMove(edict_t *ent, float time, int mask) // // modify original_velocity so it parallels all of the clip planes // - for (i = 0 ; i < numplanes ; i++) { + for (i = 0; i < numplanes; i++) { ClipVelocity(original_velocity, planes[i], new_velocity, 1); - for (j = 0 ; j < numplanes ; j++) + for (j = 0; j < numplanes; j++) if ((j != i) && !VectorCompare(planes[i], planes[j])) { if (DotProduct(new_velocity, planes[j]) < 0) break; // not ok @@ -295,7 +289,6 @@ int SV_FlyMove(edict_t *ent, float time, int mask) return blocked; } - /* ============ SV_AddGravity @@ -361,7 +354,6 @@ trace_t SV_PushEntity(edict_t *ent, vec3_t push) return trace; } - typedef struct { edict_t *ent; vec3_t origin; @@ -394,11 +386,11 @@ bool SV_Push(edict_t *pusher, vec3_t move, vec3_t amove) // clamp the move to 1/8 units, so the position will // be accurate for client side prediction - for (i = 0 ; i < 3 ; i++) + for (i = 0; i < 3; i++) move[i] = SnapToEights(move[i]); // find the bounding box - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { mins[i] = pusher->absmin[i] + move[i]; maxs[i] = pusher->absmax[i] + move[i]; } @@ -554,7 +546,7 @@ void SV_Physics_Pusher(edict_t *ent) // if the move is blocked, all moved objects will be backed out //retry: pushed_p = pushed; - for (part = ent ; part ; part = part->teamchain) { + for (part = ent; part; part = part->teamchain) { if (!VectorEmpty(part->velocity) || !VectorEmpty(part->avelocity)) { // object is moving VectorScale(part->velocity, FRAMETIME, move); @@ -569,7 +561,7 @@ void SV_Physics_Pusher(edict_t *ent) if (part) { // the move failed, bump all nextthink times and back out moves - for (mv = ent ; mv ; mv = mv->teamchain) { + for (mv = ent; mv; mv = mv->teamchain) { if (mv->nextthink > 0) mv->nextthink++; } @@ -585,7 +577,7 @@ void SV_Physics_Pusher(edict_t *ent) #endif } else { // the move succeeded, so call all think functions - for (part = ent ; part ; part = part->teamchain) { + for (part = ent; part; part = part->teamchain) { SV_RunThink(part); } } @@ -678,8 +670,7 @@ void SV_Physics_Toss(edict_t *ent) SV_CheckVelocity(ent); // add gravity - if (ent->movetype != MOVETYPE_FLY - && ent->movetype != MOVETYPE_FLYMISSILE) + if (ent->movetype != MOVETYPE_FLY && ent->movetype != MOVETYPE_FLYMISSILE) SV_AddGravity(ent); // move angles diff --git a/src/baseq2/g_save.c b/src/baseq2/g_save.c index 4d6d23395..6e232169d 100644 --- a/src/baseq2/g_save.c +++ b/src/baseq2/g_save.c @@ -951,7 +951,6 @@ void ReadGame(const char *filename) //========================================================== - /* ================= WriteLevel @@ -988,7 +987,6 @@ void WriteLevel(const char *filename) gi.error("Couldn't write %s", filename); } - /* ================= ReadLevel @@ -1070,14 +1068,14 @@ void ReadLevel(const char *filename) gzclose(f); // mark all clients as unconnected - for (i = 0 ; i < maxclients->value ; i++) { + for (i = 0; i < maxclients->value; i++) { ent = &g_edicts[i + 1]; ent->client = game.clients + i; ent->client->pers.connected = false; } // do any load time things at this point - for (i = 0 ; i < globals.num_edicts ; i++) { + for (i = 0; i < globals.num_edicts; i++) { ent = &g_edicts[i]; if (!ent->inuse) diff --git a/src/baseq2/g_spawn.c b/src/baseq2/g_spawn.c index f0d648589..c925c505b 100644 --- a/src/baseq2/g_spawn.c +++ b/src/baseq2/g_spawn.c @@ -149,191 +149,190 @@ void SP_turret_base(edict_t *self); void SP_turret_driver(edict_t *self); static const spawn_func_t spawn_funcs[] = { - {"item_health", SP_item_health}, - {"item_health_small", SP_item_health_small}, - {"item_health_large", SP_item_health_large}, - {"item_health_mega", SP_item_health_mega}, - - {"info_player_start", SP_info_player_start}, - {"info_player_deathmatch", SP_info_player_deathmatch}, - {"info_player_coop", SP_info_player_coop}, - {"info_player_intermission", SP_info_player_intermission}, - - {"func_plat", SP_func_plat}, - {"func_button", SP_func_button}, - {"func_door", SP_func_door}, - {"func_door_secret", SP_func_door_secret}, - {"func_door_rotating", SP_func_door_rotating}, - {"func_rotating", SP_func_rotating}, - {"func_train", SP_func_train}, - {"func_water", SP_func_water}, - {"func_conveyor", SP_func_conveyor}, - {"func_areaportal", SP_func_areaportal}, - {"func_clock", SP_func_clock}, - {"func_wall", SP_func_wall}, - {"func_object", SP_func_object}, - {"func_timer", SP_func_timer}, - {"func_explosive", SP_func_explosive}, - {"func_killbox", SP_func_killbox}, - - {"trigger_always", SP_trigger_always}, - {"trigger_once", SP_trigger_once}, - {"trigger_multiple", SP_trigger_multiple}, - {"trigger_relay", SP_trigger_relay}, - {"trigger_push", SP_trigger_push}, - {"trigger_hurt", SP_trigger_hurt}, - {"trigger_key", SP_trigger_key}, - {"trigger_counter", SP_trigger_counter}, - {"trigger_elevator", SP_trigger_elevator}, - {"trigger_gravity", SP_trigger_gravity}, - {"trigger_monsterjump", SP_trigger_monsterjump}, - - {"target_temp_entity", SP_target_temp_entity}, - {"target_speaker", SP_target_speaker}, - {"target_explosion", SP_target_explosion}, - {"target_changelevel", SP_target_changelevel}, - {"target_secret", SP_target_secret}, - {"target_goal", SP_target_goal}, - {"target_splash", SP_target_splash}, - {"target_spawner", SP_target_spawner}, - {"target_blaster", SP_target_blaster}, - {"target_crosslevel_trigger", SP_target_crosslevel_trigger}, - {"target_crosslevel_target", SP_target_crosslevel_target}, - {"target_laser", SP_target_laser}, - {"target_help", SP_target_help}, - {"target_actor", SP_target_actor}, - {"target_lightramp", SP_target_lightramp}, - {"target_earthquake", SP_target_earthquake}, - {"target_character", SP_target_character}, - {"target_string", SP_target_string}, - - {"worldspawn", SP_worldspawn}, - {"viewthing", SP_viewthing}, - - {"light", SP_light}, - {"light_mine1", SP_light_mine1}, - {"light_mine2", SP_light_mine2}, - {"info_null", SP_info_null}, - {"func_group", SP_info_null}, - {"info_notnull", SP_info_notnull}, - {"path_corner", SP_path_corner}, - {"point_combat", SP_point_combat}, - - {"misc_explobox", SP_misc_explobox}, - {"misc_banner", SP_misc_banner}, - {"misc_satellite_dish", SP_misc_satellite_dish}, - {"misc_actor", SP_misc_actor}, - {"misc_gib_arm", SP_misc_gib_arm}, - {"misc_gib_leg", SP_misc_gib_leg}, - {"misc_gib_head", SP_misc_gib_head}, - {"misc_insane", SP_misc_insane}, - {"misc_deadsoldier", SP_misc_deadsoldier}, - {"misc_viper", SP_misc_viper}, - {"misc_viper_bomb", SP_misc_viper_bomb}, - {"misc_bigviper", SP_misc_bigviper}, - {"misc_strogg_ship", SP_misc_strogg_ship}, - {"misc_teleporter", SP_misc_teleporter}, - {"misc_teleporter_dest", SP_misc_teleporter_dest}, - {"misc_blackhole", SP_misc_blackhole}, - {"misc_eastertank", SP_misc_eastertank}, - {"misc_easterchick", SP_misc_easterchick}, - {"misc_easterchick2", SP_misc_easterchick2}, - - {"monster_berserk", SP_monster_berserk}, - {"monster_gladiator", SP_monster_gladiator}, - {"monster_gunner", SP_monster_gunner}, - {"monster_infantry", SP_monster_infantry}, - {"monster_soldier_light", SP_monster_soldier_light}, - {"monster_soldier", SP_monster_soldier}, - {"monster_soldier_ss", SP_monster_soldier_ss}, - {"monster_tank", SP_monster_tank}, - {"monster_tank_commander", SP_monster_tank}, - {"monster_medic", SP_monster_medic}, - {"monster_flipper", SP_monster_flipper}, - {"monster_chick", SP_monster_chick}, - {"monster_parasite", SP_monster_parasite}, - {"monster_flyer", SP_monster_flyer}, - {"monster_brain", SP_monster_brain}, - {"monster_floater", SP_monster_floater}, - {"monster_hover", SP_monster_hover}, - {"monster_mutant", SP_monster_mutant}, - {"monster_supertank", SP_monster_supertank}, - {"monster_boss2", SP_monster_boss2}, - {"monster_boss3_stand", SP_monster_boss3_stand}, - {"monster_makron", SP_monster_makron}, - {"monster_jorg", SP_monster_jorg}, - - {"monster_commander_body", SP_monster_commander_body}, - - {"turret_breach", SP_turret_breach}, - {"turret_base", SP_turret_base}, - {"turret_driver", SP_turret_driver}, - - {NULL, NULL} + { "item_health", SP_item_health }, + { "item_health_small", SP_item_health_small }, + { "item_health_large", SP_item_health_large }, + { "item_health_mega", SP_item_health_mega }, + + { "info_player_start", SP_info_player_start }, + { "info_player_deathmatch", SP_info_player_deathmatch }, + { "info_player_coop", SP_info_player_coop }, + { "info_player_intermission", SP_info_player_intermission }, + + { "func_plat", SP_func_plat }, + { "func_button", SP_func_button }, + { "func_door", SP_func_door }, + { "func_door_secret", SP_func_door_secret }, + { "func_door_rotating", SP_func_door_rotating }, + { "func_rotating", SP_func_rotating }, + { "func_train", SP_func_train }, + { "func_water", SP_func_water }, + { "func_conveyor", SP_func_conveyor }, + { "func_areaportal", SP_func_areaportal }, + { "func_clock", SP_func_clock }, + { "func_wall", SP_func_wall }, + { "func_object", SP_func_object }, + { "func_timer", SP_func_timer }, + { "func_explosive", SP_func_explosive }, + { "func_killbox", SP_func_killbox }, + + { "trigger_always", SP_trigger_always }, + { "trigger_once", SP_trigger_once }, + { "trigger_multiple", SP_trigger_multiple }, + { "trigger_relay", SP_trigger_relay }, + { "trigger_push", SP_trigger_push }, + { "trigger_hurt", SP_trigger_hurt }, + { "trigger_key", SP_trigger_key }, + { "trigger_counter", SP_trigger_counter }, + { "trigger_elevator", SP_trigger_elevator }, + { "trigger_gravity", SP_trigger_gravity }, + { "trigger_monsterjump", SP_trigger_monsterjump }, + + { "target_temp_entity", SP_target_temp_entity }, + { "target_speaker", SP_target_speaker }, + { "target_explosion", SP_target_explosion }, + { "target_changelevel", SP_target_changelevel }, + { "target_secret", SP_target_secret }, + { "target_goal", SP_target_goal }, + { "target_splash", SP_target_splash }, + { "target_spawner", SP_target_spawner }, + { "target_blaster", SP_target_blaster }, + { "target_crosslevel_trigger", SP_target_crosslevel_trigger }, + { "target_crosslevel_target", SP_target_crosslevel_target }, + { "target_laser", SP_target_laser }, + { "target_help", SP_target_help }, + { "target_actor", SP_target_actor }, + { "target_lightramp", SP_target_lightramp }, + { "target_earthquake", SP_target_earthquake }, + { "target_character", SP_target_character }, + { "target_string", SP_target_string }, + + { "worldspawn", SP_worldspawn }, + { "viewthing", SP_viewthing }, + + { "light", SP_light }, + { "light_mine1", SP_light_mine1 }, + { "light_mine2", SP_light_mine2 }, + { "info_null", SP_info_null }, + { "func_group", SP_info_null }, + { "info_notnull", SP_info_notnull }, + { "path_corner", SP_path_corner }, + { "point_combat", SP_point_combat }, + + { "misc_explobox", SP_misc_explobox }, + { "misc_banner", SP_misc_banner }, + { "misc_satellite_dish", SP_misc_satellite_dish }, + { "misc_actor", SP_misc_actor }, + { "misc_gib_arm", SP_misc_gib_arm }, + { "misc_gib_leg", SP_misc_gib_leg }, + { "misc_gib_head", SP_misc_gib_head }, + { "misc_insane", SP_misc_insane }, + { "misc_deadsoldier", SP_misc_deadsoldier }, + { "misc_viper", SP_misc_viper }, + { "misc_viper_bomb", SP_misc_viper_bomb }, + { "misc_bigviper", SP_misc_bigviper }, + { "misc_strogg_ship", SP_misc_strogg_ship }, + { "misc_teleporter", SP_misc_teleporter }, + { "misc_teleporter_dest", SP_misc_teleporter_dest }, + { "misc_blackhole", SP_misc_blackhole }, + { "misc_eastertank", SP_misc_eastertank }, + { "misc_easterchick", SP_misc_easterchick }, + { "misc_easterchick2", SP_misc_easterchick2 }, + + { "monster_berserk", SP_monster_berserk }, + { "monster_gladiator", SP_monster_gladiator }, + { "monster_gunner", SP_monster_gunner }, + { "monster_infantry", SP_monster_infantry }, + { "monster_soldier_light", SP_monster_soldier_light }, + { "monster_soldier", SP_monster_soldier }, + { "monster_soldier_ss", SP_monster_soldier_ss }, + { "monster_tank", SP_monster_tank }, + { "monster_tank_commander", SP_monster_tank }, + { "monster_medic", SP_monster_medic }, + { "monster_flipper", SP_monster_flipper }, + { "monster_chick", SP_monster_chick }, + { "monster_parasite", SP_monster_parasite }, + { "monster_flyer", SP_monster_flyer }, + { "monster_brain", SP_monster_brain }, + { "monster_floater", SP_monster_floater }, + { "monster_hover", SP_monster_hover }, + { "monster_mutant", SP_monster_mutant }, + { "monster_supertank", SP_monster_supertank }, + { "monster_boss2", SP_monster_boss2 }, + { "monster_boss3_stand", SP_monster_boss3_stand }, + { "monster_makron", SP_monster_makron }, + { "monster_jorg", SP_monster_jorg }, + + { "monster_commander_body", SP_monster_commander_body }, + + { "turret_breach", SP_turret_breach }, + { "turret_base", SP_turret_base }, + { "turret_driver", SP_turret_driver }, + + { NULL, NULL } }; static const spawn_field_t spawn_fields[] = { - {"classname", FOFS(classname), F_LSTRING}, - {"model", FOFS(model), F_LSTRING}, - {"spawnflags", FOFS(spawnflags), F_INT}, - {"speed", FOFS(speed), F_FLOAT}, - {"accel", FOFS(accel), F_FLOAT}, - {"decel", FOFS(decel), F_FLOAT}, - {"target", FOFS(target), F_LSTRING}, - {"targetname", FOFS(targetname), F_LSTRING}, - {"pathtarget", FOFS(pathtarget), F_LSTRING}, - {"deathtarget", FOFS(deathtarget), F_LSTRING}, - {"killtarget", FOFS(killtarget), F_LSTRING}, - {"combattarget", FOFS(combattarget), F_LSTRING}, - {"message", FOFS(message), F_LSTRING}, - {"team", FOFS(team), F_LSTRING}, - {"wait", FOFS(wait), F_FLOAT}, - {"delay", FOFS(delay), F_FLOAT}, - {"random", FOFS(random), F_FLOAT}, - {"move_origin", FOFS(move_origin), F_VECTOR}, - {"move_angles", FOFS(move_angles), F_VECTOR}, - {"style", FOFS(style), F_INT}, - {"count", FOFS(count), F_INT}, - {"health", FOFS(health), F_INT}, - {"sounds", FOFS(sounds), F_INT}, - {"light", 0, F_IGNORE}, - {"dmg", FOFS(dmg), F_INT}, - {"mass", FOFS(mass), F_INT}, - {"volume", FOFS(volume), F_FLOAT}, - {"attenuation", FOFS(attenuation), F_FLOAT}, - {"map", FOFS(map), F_LSTRING}, - {"origin", FOFS(s.origin), F_VECTOR}, - {"angles", FOFS(s.angles), F_VECTOR}, - {"angle", FOFS(s.angles), F_ANGLEHACK}, - - {NULL} + { "classname", FOFS(classname), F_LSTRING }, + { "model", FOFS(model), F_LSTRING }, + { "spawnflags", FOFS(spawnflags), F_INT }, + { "speed", FOFS(speed), F_FLOAT }, + { "accel", FOFS(accel), F_FLOAT }, + { "decel", FOFS(decel), F_FLOAT }, + { "target", FOFS(target), F_LSTRING }, + { "targetname", FOFS(targetname), F_LSTRING }, + { "pathtarget", FOFS(pathtarget), F_LSTRING }, + { "deathtarget", FOFS(deathtarget), F_LSTRING }, + { "killtarget", FOFS(killtarget), F_LSTRING }, + { "combattarget", FOFS(combattarget), F_LSTRING }, + { "message", FOFS(message), F_LSTRING }, + { "team", FOFS(team), F_LSTRING }, + { "wait", FOFS(wait), F_FLOAT }, + { "delay", FOFS(delay), F_FLOAT }, + { "random", FOFS(random), F_FLOAT }, + { "move_origin", FOFS(move_origin), F_VECTOR }, + { "move_angles", FOFS(move_angles), F_VECTOR }, + { "style", FOFS(style), F_INT }, + { "count", FOFS(count), F_INT }, + { "health", FOFS(health), F_INT }, + { "sounds", FOFS(sounds), F_INT }, + { "light", 0, F_IGNORE }, + { "dmg", FOFS(dmg), F_INT }, + { "mass", FOFS(mass), F_INT }, + { "volume", FOFS(volume), F_FLOAT }, + { "attenuation", FOFS(attenuation), F_FLOAT }, + { "map", FOFS(map), F_LSTRING }, + { "origin", FOFS(s.origin), F_VECTOR }, + { "angles", FOFS(s.angles), F_VECTOR }, + { "angle", FOFS(s.angles), F_ANGLEHACK }, + + { NULL } }; // temp spawn vars -- only valid when the spawn function is called static const spawn_field_t temp_fields[] = { - {"lip", STOFS(lip), F_INT}, - {"distance", STOFS(distance), F_INT}, - {"height", STOFS(height), F_INT}, - {"noise", STOFS(noise), F_LSTRING}, - {"pausetime", STOFS(pausetime), F_FLOAT}, - {"item", STOFS(item), F_LSTRING}, - - {"gravity", STOFS(gravity), F_LSTRING}, - {"sky", STOFS(sky), F_LSTRING}, - {"skyrotate", STOFS(skyrotate), F_FLOAT}, - {"skyautorotate", STOFS(skyautorotate), F_INT}, - {"skyaxis", STOFS(skyaxis), F_VECTOR}, - {"minyaw", STOFS(minyaw), F_FLOAT}, - {"maxyaw", STOFS(maxyaw), F_FLOAT}, - {"minpitch", STOFS(minpitch), F_FLOAT}, - {"maxpitch", STOFS(maxpitch), F_FLOAT}, - {"nextmap", STOFS(nextmap), F_LSTRING}, - {"musictrack", STOFS(musictrack), F_LSTRING}, - - {NULL} + { "lip", STOFS(lip), F_INT }, + { "distance", STOFS(distance), F_INT }, + { "height", STOFS(height), F_INT }, + { "noise", STOFS(noise), F_LSTRING }, + { "pausetime", STOFS(pausetime), F_FLOAT }, + { "item", STOFS(item), F_LSTRING }, + + { "gravity", STOFS(gravity), F_LSTRING }, + { "sky", STOFS(sky), F_LSTRING }, + { "skyrotate", STOFS(skyrotate), F_FLOAT }, + { "skyautorotate", STOFS(skyautorotate), F_INT }, + { "skyaxis", STOFS(skyaxis), F_VECTOR }, + { "minyaw", STOFS(minyaw), F_FLOAT }, + { "maxyaw", STOFS(maxyaw), F_FLOAT }, + { "minpitch", STOFS(minpitch), F_FLOAT }, + { "maxpitch", STOFS(maxpitch), F_FLOAT }, + { "nextmap", STOFS(nextmap), F_LSTRING }, + { "musictrack", STOFS(musictrack), F_LSTRING }, + + { NULL } }; - /* =============== ED_CallSpawn @@ -353,7 +352,7 @@ void ED_CallSpawn(edict_t *ent) } // check item spawn functions - for (i = 0, item = itemlist ; i < game.num_items ; i++, item++) { + for (i = 0, item = itemlist; i < game.num_items; i++, item++) { if (!item->classname) continue; if (!strcmp(item->classname, ent->classname)) { @@ -364,7 +363,7 @@ void ED_CallSpawn(edict_t *ent) } // check normal spawn functions - for (s = spawn_funcs ; s->name ; s++) { + for (s = spawn_funcs; s->name; s++) { if (!strcmp(s->name, ent->classname)) { // found it s->spawn(ent); @@ -390,7 +389,7 @@ static char *ED_NewString(const char *string) new_p = newb; - for (i = 0 ; i < l ; i++) { + for (i = 0; i < l; i++) { if (string[i] == '\\' && i < l - 1) { i++; if (string[i] == 'n') @@ -404,9 +403,6 @@ static char *ED_NewString(const char *string) return newb; } - - - /* =============== ED_ParseField @@ -421,7 +417,7 @@ static bool ED_ParseField(const spawn_field_t *fields, const char *key, const ch float v; vec3_t vec; - for (f = fields ; f->name ; f++) { + for (f = fields; f->name; f++) { if (!Q_stricmp(f->name, key)) { // found it switch (f->type) { @@ -512,7 +508,6 @@ void ED_ParseEdict(const char **data, edict_t *ent) memset(ent, 0, sizeof(*ent)); } - /* ================ G_FindTeams @@ -531,7 +526,7 @@ void G_FindTeams(void) c = 0; c2 = 0; - for (i = 1, e = g_edicts + i ; i < globals.num_edicts ; i++, e++) { + for (i = 1, e = g_edicts + i; i < globals.num_edicts; i++, e++) { if (!e->inuse) continue; if (!e->team) @@ -542,7 +537,7 @@ void G_FindTeams(void) e->teammaster = e; c++; c2++; - for (j = i + 1, e2 = e + 1 ; j < globals.num_edicts ; j++, e2++) { + for (j = i + 1, e2 = e + 1; j < globals.num_edicts; j++, e2++) { if (!e2->inuse) continue; if (!e2->team) @@ -594,7 +589,7 @@ void SpawnEntities(const char *mapname, const char *entities, const char *spawnp Q_strlcpy(game.spawnpoint, spawnpoint, sizeof(game.spawnpoint)); // set client fields on player ents - for (i = 0 ; i < game.maxclients ; i++) + for (i = 0; i < game.maxclients; i++) g_edicts[i + 1].client = game.clients + i; ent = NULL; @@ -667,7 +662,6 @@ void SpawnEntities(const char *mapname, const char *entities, const char *spawnp PlayerTrail_Init(); } - //=================================================================== #if 0 @@ -784,7 +778,6 @@ static const char dm_statusbar[] = "endif " ; - /*QUAKED worldspawn (0 0 0) ? Only used for the world. @@ -846,7 +839,6 @@ void SP_worldspawn(edict_t *ent) //--------------- - // help icon for statusbar gi.imageindex("i_help"); level.pic_health = gi.imageindex("i_health"); diff --git a/src/baseq2/g_svcmds.c b/src/baseq2/g_svcmds.c index d6f7b8fe8..65bbe1171 100644 --- a/src/baseq2/g_svcmds.c +++ b/src/baseq2/g_svcmds.c @@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "g_local.h" - void Svcmd_Test_f(void) { gi.cprintf(NULL, PRINT_HIGH, "Svcmd_Test_f()\n"); @@ -29,7 +28,6 @@ void Svcmd_Test_f(void) PACKET FILTERING - You can add or remove addresses from the filter list with: addip @@ -51,7 +49,6 @@ If 1 (the default), then ip addresses matching the current list will be prohibit If 0, then only addresses matching the list will be allowed. This lets you easily set up a private game, or a game that only allows players from your local network. - ============================================================================== */ @@ -81,7 +78,7 @@ static bool StringToFilter(char *s, ipfilter_t *f) b.u32 = m.u32 = 0; - for (i = 0 ; i < 4 ; i++) { + for (i = 0; i < 4; i++) { if (*s < '0' || *s > '9') { gi.cprintf(NULL, PRINT_HIGH, "Bad filter address: %s\n", s); return false; @@ -139,14 +136,13 @@ bool SV_FilterPacket(char *from) in = m.u32; - for (i = 0 ; i < numipfilters ; i++) + for (i = 0; i < numipfilters; i++) if ((in & ipfilters[i].mask) == ipfilters[i].compare) return (int)filterban->value; return (int)!filterban->value; } - /* ================= SV_AddIP_f @@ -161,7 +157,7 @@ void SVCmd_AddIP_f(void) return; } - for (i = 0 ; i < numipfilters ; i++) + for (i = 0; i < numipfilters; i++) if (ipfilters[i].compare == 0xffffffff) break; // free spot if (i == numipfilters) { @@ -194,10 +190,10 @@ void SVCmd_RemoveIP_f(void) if (!StringToFilter(gi.argv(2), &f)) return; - for (i = 0 ; i < numipfilters ; i++) + for (i = 0; i < numipfilters; i++) if (ipfilters[i].mask == f.mask && ipfilters[i].compare == f.compare) { - for (j = i + 1 ; j < numipfilters ; j++) + for (j = i + 1; j < numipfilters; j++) ipfilters[j - 1] = ipfilters[j]; numipfilters--; gi.cprintf(NULL, PRINT_HIGH, "Removed.\n"); @@ -220,7 +216,7 @@ void SVCmd_ListIP_f(void) } b; gi.cprintf(NULL, PRINT_HIGH, "Filter list:\n"); - for (i = 0 ; i < numipfilters ; i++) { + for (i = 0; i < numipfilters; i++) { b.u32 = ipfilters[i].compare; gi.cprintf(NULL, PRINT_HIGH, "%3i.%3i.%3i.%3i\n", b.b[0], b.b[1], b.b[2], b.b[3]); } @@ -265,7 +261,7 @@ void SVCmd_WriteIP_f(void) fprintf(f, "set filterban %d\n", (int)filterban->value); - for (i = 0 ; i < numipfilters ; i++) { + for (i = 0; i < numipfilters; i++) { b.u32 = ipfilters[i].compare; fprintf(f, "sv addip %i.%i.%i.%i\n", b.b[0], b.b[1], b.b[2], b.b[3]); } diff --git a/src/baseq2/g_target.c b/src/baseq2/g_target.c index 29cfc38ae..d8a840f46 100644 --- a/src/baseq2/g_target.c +++ b/src/baseq2/g_target.c @@ -34,7 +34,6 @@ void SP_target_temp_entity(edict_t *ent) ent->use = Use_Target_Tent; } - //========================================================== //========================================================== @@ -108,7 +107,6 @@ void SP_target_speaker(edict_t *ent) gi.linkentity(ent); } - //========================================================== void Use_Target_Help(edict_t *ent, edict_t *other, edict_t *activator) @@ -212,7 +210,6 @@ void SP_target_goal(edict_t *ent) //========================================================== - /*QUAKED target_explosion (1 0 0) (-8 -8 -8) (8 8 8) Spawns an explosion temporary entity when used. @@ -255,7 +252,6 @@ void SP_target_explosion(edict_t *ent) ent->svflags = SVF_NOCLIENT; } - //========================================================== /*QUAKED target_changelevel (1 0 0) (-8 -8 -8) (8 8 8) @@ -306,7 +302,6 @@ void SP_target_changelevel(edict_t *ent) ent->svflags = SVF_NOCLIENT; } - //========================================================== /*QUAKED target_splash (1 0 0) (-8 -8 -8) (8 8 8) @@ -350,7 +345,6 @@ void SP_target_splash(edict_t *self) self->svflags = SVF_NOCLIENT; } - //========================================================== /*QUAKED target_spawner (1 0 0) (-8 -8 -8) (8 8 8) @@ -433,7 +427,6 @@ void SP_target_blaster(edict_t *self) self->svflags = SVF_NOCLIENT; } - //========================================================== /*QUAKED target_crosslevel_trigger (.5 .5 .5) (-8 -8 -8) (8 8 8) trigger1 trigger2 trigger3 trigger4 trigger5 trigger6 trigger7 trigger8 diff --git a/src/baseq2/g_trigger.c b/src/baseq2/g_trigger.c index 37a18ce84..d6cddafd0 100644 --- a/src/baseq2/g_trigger.c +++ b/src/baseq2/g_trigger.c @@ -17,7 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "g_local.h" - void InitTrigger(edict_t *self) { if (!VectorEmpty(self->s.angles)) @@ -29,14 +28,12 @@ void InitTrigger(edict_t *self) self->svflags = SVF_NOCLIENT; } - // the wait time has passed, so set back up for another activation void multi_wait(edict_t *ent) { ent->nextthink = 0; } - // the trigger was just activated // ent->activator should be set to the activator so it can be held through a delay // so wait for the delay time before firing @@ -121,7 +118,6 @@ void SP_trigger_multiple(edict_t *ent) ent->movetype = MOVETYPE_NONE; ent->svflags |= SVF_NOCLIENT; - if (ent->spawnflags & 4) { ent->solid = SOLID_NOT; ent->use = trigger_enable; @@ -137,7 +133,6 @@ void SP_trigger_multiple(edict_t *ent) gi.linkentity(ent); } - /*QUAKED trigger_once (.5 .5 .5) ? x x TRIGGERED Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching "targetname". @@ -183,7 +178,6 @@ void SP_trigger_relay(edict_t *self) self->use = trigger_relay_use; } - /* ============================================================================== @@ -280,7 +274,6 @@ void SP_trigger_key(edict_t *self) self->use = trigger_key_use; } - /* ============================================================================== @@ -329,7 +322,6 @@ void SP_trigger_counter(edict_t *self) self->use = trigger_counter_use; } - /* ============================================================================== @@ -349,7 +341,6 @@ void SP_trigger_always(edict_t *ent) G_UseTargets(ent, ent); } - /* ============================================================================== @@ -382,7 +373,6 @@ void trigger_push_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface G_FreeEdict(self); } - /*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE Pushes the player "speed" defaults to 1000 @@ -397,7 +387,6 @@ void SP_trigger_push(edict_t *self) gi.linkentity(self); } - /* ============================================================================== @@ -430,7 +419,6 @@ void hurt_use(edict_t *self, edict_t *other, edict_t *activator) self->use = NULL; } - void hurt_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) { int dflags; @@ -479,7 +467,6 @@ void SP_trigger_hurt(edict_t *self) gi.linkentity(self); } - /* ============================================================================== @@ -512,7 +499,6 @@ void SP_trigger_gravity(edict_t *self) self->touch = trigger_gravity_touch; } - /* ============================================================================== diff --git a/src/baseq2/g_turret.c b/src/baseq2/g_turret.c index ce5bae19c..49aa226fb 100644 --- a/src/baseq2/g_turret.c +++ b/src/baseq2/g_turret.c @@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "g_local.h" - void AnglesNormalize(vec3_t vec) { while (vec[0] > 360) @@ -42,7 +41,6 @@ float SnapToEights(float x) return 0.125f * (int)x; } - void turret_blocked(edict_t *self, edict_t *other) { edict_t *attacker; @@ -241,7 +239,6 @@ void SP_turret_breach(edict_t *self) gi.linkentity(self); } - /*QUAKED turret_base (0 0 0) ? This portion of the turret changes yaw only. MUST be teamed with a turret_breach. @@ -256,7 +253,6 @@ void SP_turret_base(edict_t *self) gi.linkentity(self); } - /*QUAKED turret_driver (1 .5 0) (-16 -16 -24) (16 16 32) Must NOT be on the team with the rest of the turret parts. Instead it must target the turret_breach. diff --git a/src/baseq2/g_utils.c b/src/baseq2/g_utils.c index ac8bf2347..1f542a10a 100644 --- a/src/baseq2/g_utils.c +++ b/src/baseq2/g_utils.c @@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "g_local.h" - void G_ProjectSource(const vec3_t point, const vec3_t distance, const vec3_t forward, const vec3_t right, vec3_t result) { result[0] = point[0] + forward[0] * distance[0] + right[0] * distance[1]; @@ -27,7 +26,6 @@ void G_ProjectSource(const vec3_t point, const vec3_t distance, const vec3_t for result[2] = point[2] + forward[2] * distance[0] + right[2] * distance[1] + distance[2]; } - /* ============= G_Find @@ -49,7 +47,7 @@ edict_t *G_Find(edict_t *from, int fieldofs, char *match) else from++; - for (; from < &g_edicts[globals.num_edicts] ; from++) { + for (; from < &g_edicts[globals.num_edicts]; from++) { if (!from->inuse) continue; s = *(char **)((byte *)from + fieldofs); @@ -62,7 +60,6 @@ edict_t *G_Find(edict_t *from, int fieldofs, char *match) return NULL; } - /* ================= findradius @@ -86,7 +83,7 @@ edict_t *findradius(edict_t *from, vec3_t org, float rad) continue; if (from->solid == SOLID_NOT) continue; - for (j = 0 ; j < 3 ; j++) + for (j = 0; j < 3; j++) eorg[j] = org[j] - (from->s.origin[j] + (from->mins[j] + from->maxs[j]) * 0.5f); if (VectorLength(eorg) > rad) continue; @@ -96,7 +93,6 @@ edict_t *findradius(edict_t *from, vec3_t org, float rad) return NULL; } - /* ============= G_PickTarget @@ -139,8 +135,6 @@ edict_t *G_PickTarget(char *targetname) return choice[Q_rand_uniform(num_choices)]; } - - void Think_Delay(edict_t *ent) { G_UseTargets(ent, ent->activator); @@ -185,7 +179,6 @@ void G_UseTargets(edict_t *ent, edict_t *activator) return; } - // // print the message // @@ -236,11 +229,10 @@ void G_UseTargets(edict_t *ent, edict_t *activator) } } - -static const vec3_t VEC_UP = {0, -1, 0}; -static const vec3_t MOVEDIR_UP = {0, 0, 1}; -static const vec3_t VEC_DOWN = {0, -2, 0}; -static const vec3_t MOVEDIR_DOWN = {0, 0, -1}; +static const vec3_t VEC_UP = { 0, -1, 0 }; +static const vec3_t MOVEDIR_UP = { 0, 0, 1 }; +static const vec3_t VEC_DOWN = { 0, -2, 0 }; +static const vec3_t MOVEDIR_DOWN = { 0, 0, -1 }; void G_SetMovedir(vec3_t angles, vec3_t movedir) { @@ -255,7 +247,6 @@ void G_SetMovedir(vec3_t angles, vec3_t movedir) VectorClear(angles); } - float vectoyaw(vec3_t vec) { float yaw; @@ -275,7 +266,6 @@ float vectoyaw(vec3_t vec) return yaw; } - void vectoangles(vec3_t value1, vec3_t angles) { float forward; @@ -317,7 +307,6 @@ char *G_CopyString(char *in) return out; } - void G_InitEdict(edict_t *e) { e->inuse = true; @@ -343,7 +332,7 @@ edict_t *G_Spawn(void) edict_t *e; e = &g_edicts[game.maxclients + 1]; - for (i = game.maxclients + 1 ; i < globals.num_edicts ; i++, e++) { + for (i = game.maxclients + 1; i < globals.num_edicts; i++, e++) { // the first couple seconds of server time can involve a lot of // freeing and allocating, so relax the replacement policy if (!e->inuse && (e->freetime < 2 || level.time - e->freetime > 0.5f)) { @@ -382,14 +371,13 @@ void G_FreeEdict(edict_t *ed) ed->inuse = false; } - /* ============ G_TouchTriggers ============ */ -void G_TouchTriggers(edict_t *ent) +void G_TouchTriggers(edict_t *ent) { int i, num; edict_t *touch[MAX_EDICTS], *hit; @@ -398,12 +386,11 @@ void G_TouchTriggers(edict_t *ent) if ((ent->client || (ent->svflags & SVF_MONSTER)) && (ent->health <= 0)) return; - num = gi.BoxEdicts(ent->absmin, ent->absmax, touch - , MAX_EDICTS, AREA_TRIGGERS); + num = gi.BoxEdicts(ent->absmin, ent->absmax, touch, MAX_EDICTS, AREA_TRIGGERS); // be careful, it is possible to have an entity in this // list removed before we get to it (killtriggered) - for (i = 0 ; i < num ; i++) { + for (i = 0; i < num; i++) { hit = touch[i]; if (!hit->inuse) continue; @@ -421,17 +408,16 @@ Call after linking a new trigger in during gameplay to force all entities it covers to immediately touch it ============ */ -void G_TouchSolids(edict_t *ent) +void G_TouchSolids(edict_t *ent) { int i, num; edict_t *touch[MAX_EDICTS], *hit; - num = gi.BoxEdicts(ent->absmin, ent->absmax, touch - , MAX_EDICTS, AREA_SOLID); + num = gi.BoxEdicts(ent->absmin, ent->absmax, touch, MAX_EDICTS, AREA_SOLID); // be careful, it is possible to have an entity in this // list removed before we get to it (killtriggered) - for (i = 0 ; i < num ; i++) { + for (i = 0; i < num; i++) { hit = touch[i]; if (!hit->inuse) continue; @@ -442,9 +428,6 @@ void G_TouchSolids(edict_t *ent) } } - - - /* ============================================================================== diff --git a/src/baseq2/g_weapon.c b/src/baseq2/g_weapon.c index 35918341f..0b6d4f81f 100644 --- a/src/baseq2/g_weapon.c +++ b/src/baseq2/g_weapon.c @@ -17,7 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "g_local.h" - /* ================= check_dodge @@ -48,7 +47,6 @@ static void check_dodge(edict_t *self, vec3_t start, vec3_t dir, int speed) } } - /* ================= fire_hit @@ -115,7 +113,6 @@ bool fire_hit(edict_t *self, vec3_t aim, int damage, int kick) return true; } - /* ================= fire_lead @@ -243,7 +240,6 @@ static void fire_lead(edict_t *self, vec3_t start, vec3_t aimdir, int damage, in } } - /* ================= fire_bullet @@ -257,7 +253,6 @@ void fire_bullet(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kic fire_lead(self, start, aimdir, damage, kick, TE_GUNSHOT, hspread, vspread, mod); } - /* ================= fire_shotgun @@ -273,7 +268,6 @@ void fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int ki fire_lead(self, start, aimdir, damage, kick, TE_SHOTGUN, hspread, vspread, mod); } - /* ================= fire_blaster @@ -363,7 +357,6 @@ void fire_blaster(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed } } - /* ================= fire_grenade @@ -530,7 +523,6 @@ void fire_grenade2(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int s } } - /* ================= fire_rocket @@ -613,7 +605,6 @@ void fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, gi.linkentity(rocket); } - /* ================= fire_rail @@ -676,7 +667,6 @@ void fire_rail(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick) PlayerNoise(self, tr.endpos, PNOISE_IMPACT); } - /* ================= fire_bfg @@ -761,7 +751,6 @@ void bfg_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) gi.multicast(self->s.origin, MULTICAST_PVS); } - void bfg_think(edict_t *self) { edict_t *ent; @@ -836,7 +825,6 @@ void bfg_think(edict_t *self) self->nextthink = level.framenum + 1; } - void fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius) { edict_t *bfg; diff --git a/src/baseq2/m_actor.c b/src/baseq2/m_actor.c index 0b8d30558..685dd6c83 100644 --- a/src/baseq2/m_actor.c +++ b/src/baseq2/m_actor.c @@ -32,8 +32,7 @@ static const char *const actor_names[MAX_ACTOR_NAMES] = { "Bitterman" }; - -static const mframe_t actor_frames_stand [] = { +static const mframe_t actor_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -89,8 +88,7 @@ void actor_stand(edict_t *self) self->s.frame = self->monsterinfo.currentmove->firstframe + (Q_rand() % (self->monsterinfo.currentmove->lastframe - self->monsterinfo.currentmove->firstframe + 1)); } - -static const mframe_t actor_frames_walk [] = { +static const mframe_t actor_frames_walk[] = { { ai_walk, 0, NULL }, { ai_walk, 6, NULL }, { ai_walk, 10, NULL }, @@ -110,8 +108,7 @@ void actor_walk(edict_t *self) self->monsterinfo.currentmove = &actor_move_walk; } - -static const mframe_t actor_frames_run [] = { +static const mframe_t actor_frames_run[] = { { ai_run, 4, NULL }, { ai_run, 15, NULL }, { ai_run, 15, NULL }, @@ -145,29 +142,28 @@ void actor_run(edict_t *self) self->monsterinfo.currentmove = &actor_move_run; } - -static const mframe_t actor_frames_pain1 [] = { +static const mframe_t actor_frames_pain1[] = { { ai_move, -5, NULL }, { ai_move, 4, NULL }, { ai_move, 1, NULL } }; const mmove_t actor_move_pain1 = {FRAME_pain101, FRAME_pain103, actor_frames_pain1, actor_run}; -static const mframe_t actor_frames_pain2 [] = { +static const mframe_t actor_frames_pain2[] = { { ai_move, -4, NULL }, { ai_move, 4, NULL }, { ai_move, 0, NULL } }; const mmove_t actor_move_pain2 = {FRAME_pain201, FRAME_pain203, actor_frames_pain2, actor_run}; -static const mframe_t actor_frames_pain3 [] = { +static const mframe_t actor_frames_pain3[] = { { ai_move, -1, NULL }, { ai_move, 1, NULL }, { ai_move, 0, NULL } }; const mmove_t actor_move_pain3 = {FRAME_pain301, FRAME_pain303, actor_frames_pain3, actor_run}; -static const mframe_t actor_frames_flipoff [] = { +static const mframe_t actor_frames_flipoff[] = { { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, @@ -185,7 +181,7 @@ static const mframe_t actor_frames_flipoff [] = { }; const mmove_t actor_move_flipoff = {FRAME_flip01, FRAME_flip14, actor_frames_flipoff, actor_run}; -static const mframe_t actor_frames_taunt [] = { +static const mframe_t actor_frames_taunt[] = { { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, { ai_turn, 0, NULL }, @@ -250,7 +246,6 @@ void actor_pain(edict_t *self, edict_t *other, float kick, int damage) self->monsterinfo.currentmove = &actor_move_pain3; } - void actorMachineGun(edict_t *self) { vec3_t start, target; @@ -274,7 +269,6 @@ void actorMachineGun(edict_t *self) monster_fire_bullet(self, start, forward, 3, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_ACTOR_MACHINEGUN_1); } - void actor_dead(edict_t *self) { VectorSet(self->mins, -16, -16, -24); @@ -285,7 +279,7 @@ void actor_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t actor_frames_death1 [] = { +static const mframe_t actor_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, -13, NULL }, @@ -296,7 +290,7 @@ static const mframe_t actor_frames_death1 [] = { }; const mmove_t actor_move_death1 = {FRAME_death101, FRAME_death107, actor_frames_death1, actor_dead}; -static const mframe_t actor_frames_death2 [] = { +static const mframe_t actor_frames_death2[] = { { ai_move, 0, NULL }, { ai_move, 7, NULL }, { ai_move, -6, NULL }, @@ -344,7 +338,6 @@ void actor_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, self->monsterinfo.currentmove = &actor_move_death2; } - void actor_fire(edict_t *self) { actorMachineGun(self); @@ -355,7 +348,7 @@ void actor_fire(edict_t *self) self->monsterinfo.aiflags |= AI_HOLD_FRAME; } -static const mframe_t actor_frames_attack [] = { +static const mframe_t actor_frames_attack[] = { { ai_charge, -2, actor_fire }, { ai_charge, -2, NULL }, { ai_charge, 3, NULL }, @@ -372,7 +365,6 @@ void actor_attack(edict_t *self) self->monsterinfo.pause_framenum = level.framenum + n; } - void actor_use(edict_t *self, edict_t *other, edict_t *activator) { vec3_t v; @@ -392,7 +384,6 @@ void actor_use(edict_t *self, edict_t *other, edict_t *activator) self->target = NULL; } - /*QUAKED misc_actor (1 .5 0) (-16 -16 -24) (16 16 32) */ @@ -448,7 +439,6 @@ void SP_misc_actor(edict_t *self) self->use = actor_use; } - /*QUAKED target_actor (.5 .3 0) (-8 -8 -8) (8 8 8) JUMP SHOOT ATTACK x HOLD BRUTAL JUMP jump in set direction upon reaching this target SHOOT take a single shot at the pathtarget diff --git a/src/baseq2/m_berserk.c b/src/baseq2/m_berserk.c index ae74b2f63..d0c534577 100644 --- a/src/baseq2/m_berserk.c +++ b/src/baseq2/m_berserk.c @@ -26,7 +26,6 @@ BERSERK #include "g_local.h" #include "m_berserk.h" - static int sound_pain; static int sound_die; static int sound_idle; @@ -44,9 +43,8 @@ void berserk_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } - void berserk_fidget(edict_t *self); -static const mframe_t berserk_frames_stand [] = { +static const mframe_t berserk_frames_stand[] = { { ai_stand, 0, berserk_fidget }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -60,7 +58,7 @@ void berserk_stand(edict_t *self) self->monsterinfo.currentmove = &berserk_move_stand; } -static const mframe_t berserk_frames_stand_fidget [] = { +static const mframe_t berserk_frames_stand_fidget[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -95,8 +93,7 @@ void berserk_fidget(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_idle, 1, ATTN_IDLE, 0); } - -static const mframe_t berserk_frames_walk [] = { +static const mframe_t berserk_frames_walk[] = { { ai_walk, 9.1, NULL }, { ai_walk, 6.3, NULL }, { ai_walk, 4.9, NULL }, @@ -141,8 +138,7 @@ void() berserk_runb12 =[ $r_att12 , berserk_runb7 ] {{ ai_run(19);}; // running with arm in air : end loop */ - -static const mframe_t berserk_frames_run1 [] = { +static const mframe_t berserk_frames_run1[] = { { ai_run, 21, NULL }, { ai_run, 11, NULL }, { ai_run, 21, NULL }, @@ -160,20 +156,18 @@ void berserk_run(edict_t *self) self->monsterinfo.currentmove = &berserk_move_run1; } - void berserk_attack_spike(edict_t *self) { vec3_t aim = {MELEE_DISTANCE, 0, -24}; fire_hit(self, aim, (15 + (Q_rand() % 6)), 400); // Faster attack -- upwards and backwards } - void berserk_swing(edict_t *self) { gi.sound(self, CHAN_WEAPON, sound_punch, 1, ATTN_NORM, 0); } -static const mframe_t berserk_frames_attack_spike [] = { +static const mframe_t berserk_frames_attack_spike[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, berserk_swing }, @@ -185,7 +179,6 @@ static const mframe_t berserk_frames_attack_spike [] = { }; const mmove_t berserk_move_attack_spike = {FRAME_att_c1, FRAME_att_c8, berserk_frames_attack_spike, berserk_run}; - void berserk_attack_club(edict_t *self) { vec3_t aim; @@ -194,7 +187,7 @@ void berserk_attack_club(edict_t *self) fire_hit(self, aim, (5 + (Q_rand() % 6)), 400); // Slower attack } -static const mframe_t berserk_frames_attack_club [] = { +static const mframe_t berserk_frames_attack_club[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -210,14 +203,12 @@ static const mframe_t berserk_frames_attack_club [] = { }; const mmove_t berserk_move_attack_club = {FRAME_att_c9, FRAME_att_c20, berserk_frames_attack_club, berserk_run}; - void berserk_strike(edict_t *self) { //FIXME play impact sound } - -static const mframe_t berserk_frames_attack_strike [] = { +static const mframe_t berserk_frames_attack_strike[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -236,7 +227,6 @@ static const mframe_t berserk_frames_attack_strike [] = { const mmove_t berserk_move_attack_strike = {FRAME_att_c21, FRAME_att_c34, berserk_frames_attack_strike, berserk_run}; - void berserk_melee(edict_t *self) { if ((Q_rand() % 2) == 0) @@ -245,7 +235,6 @@ void berserk_melee(edict_t *self) self->monsterinfo.currentmove = &berserk_move_attack_club; } - /* void() berserk_atke1 =[ $r_attb1, berserk_atke2 ] {{ ai_run(9);}; void() berserk_atke2 =[ $r_attb2, berserk_atke3 ] {{ ai_run(6);}; @@ -267,8 +256,7 @@ void() berserk_atke17 =[ $r_attb17, berserk_atke18 ] {{ ai_run(19.6);}; void() berserk_atke18 =[ $r_attb18, berserk_run1 ] {{ ai_run(7.8);}; */ - -static const mframe_t berserk_frames_pain1 [] = { +static const mframe_t berserk_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -276,8 +264,7 @@ static const mframe_t berserk_frames_pain1 [] = { }; const mmove_t berserk_move_pain1 = {FRAME_painc1, FRAME_painc4, berserk_frames_pain1, berserk_run}; - -static const mframe_t berserk_frames_pain2 [] = { +static const mframe_t berserk_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -321,7 +308,6 @@ void berserk_pain(edict_t *self, edict_t *other, float kick, int damage) self->monsterinfo.currentmove = &berserk_move_pain2; } - void berserk_dead(edict_t *self) { VectorSet(self->mins, -16, -16, -24); @@ -332,8 +318,7 @@ void berserk_dead(edict_t *self) gi.linkentity(self); } - -static const mframe_t berserk_frames_death1 [] = { +static const mframe_t berserk_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -351,8 +336,7 @@ static const mframe_t berserk_frames_death1 [] = { }; const mmove_t berserk_move_death1 = {FRAME_death1, FRAME_death13, berserk_frames_death1, berserk_dead}; - -static const mframe_t berserk_frames_death2 [] = { +static const mframe_t berserk_frames_death2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -364,7 +348,6 @@ static const mframe_t berserk_frames_death2 [] = { }; const mmove_t berserk_move_death2 = {FRAME_deathc1, FRAME_deathc8, berserk_frames_death2, berserk_dead}; - void berserk_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; @@ -393,7 +376,6 @@ void berserk_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damag self->monsterinfo.currentmove = &berserk_move_death2; } - /*QUAKED monster_berserk (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight */ void SP_monster_berserk(edict_t *self) diff --git a/src/baseq2/m_boss2.c b/src/baseq2/m_boss2.c index ee0cc78d7..0311de7da 100644 --- a/src/baseq2/m_boss2.c +++ b/src/baseq2/m_boss2.c @@ -131,8 +131,7 @@ void Boss2MachineGun(edict_t *self) boss2_firebullet_right(self); } - -static const mframe_t boss2_frames_stand [] = { +static const mframe_t boss2_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -157,7 +156,7 @@ static const mframe_t boss2_frames_stand [] = { }; const mmove_t boss2_move_stand = {FRAME_stand30, FRAME_stand50, boss2_frames_stand, NULL}; -static const mframe_t boss2_frames_fidget [] = { +static const mframe_t boss2_frames_fidget[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -191,7 +190,7 @@ static const mframe_t boss2_frames_fidget [] = { }; const mmove_t boss2_move_fidget = {FRAME_stand1, FRAME_stand30, boss2_frames_fidget, NULL}; -static const mframe_t boss2_frames_walk [] = { +static const mframe_t boss2_frames_walk[] = { { ai_walk, 8, NULL }, { ai_walk, 8, NULL }, { ai_walk, 8, NULL }, @@ -215,8 +214,7 @@ static const mframe_t boss2_frames_walk [] = { }; const mmove_t boss2_move_walk = {FRAME_walk1, FRAME_walk20, boss2_frames_walk, NULL}; - -static const mframe_t boss2_frames_run [] = { +static const mframe_t boss2_frames_run[] = { { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, NULL }, @@ -240,7 +238,7 @@ static const mframe_t boss2_frames_run [] = { }; const mmove_t boss2_move_run = {FRAME_walk1, FRAME_walk20, boss2_frames_run, NULL}; -static const mframe_t boss2_frames_attack_pre_mg [] = { +static const mframe_t boss2_frames_attack_pre_mg[] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, @@ -253,9 +251,8 @@ static const mframe_t boss2_frames_attack_pre_mg [] = { }; const mmove_t boss2_move_attack_pre_mg = {FRAME_attack1, FRAME_attack9, boss2_frames_attack_pre_mg, NULL}; - // Loop this -static const mframe_t boss2_frames_attack_mg [] = { +static const mframe_t boss2_frames_attack_mg[] = { { ai_charge, 1, Boss2MachineGun }, { ai_charge, 1, Boss2MachineGun }, { ai_charge, 1, Boss2MachineGun }, @@ -265,7 +262,7 @@ static const mframe_t boss2_frames_attack_mg [] = { }; const mmove_t boss2_move_attack_mg = {FRAME_attack10, FRAME_attack15, boss2_frames_attack_mg, NULL}; -static const mframe_t boss2_frames_attack_post_mg [] = { +static const mframe_t boss2_frames_attack_post_mg[] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, @@ -273,7 +270,7 @@ static const mframe_t boss2_frames_attack_post_mg [] = { }; const mmove_t boss2_move_attack_post_mg = {FRAME_attack16, FRAME_attack19, boss2_frames_attack_post_mg, boss2_run}; -static const mframe_t boss2_frames_attack_rocket [] = { +static const mframe_t boss2_frames_attack_rocket[] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, @@ -298,7 +295,7 @@ static const mframe_t boss2_frames_attack_rocket [] = { }; const mmove_t boss2_move_attack_rocket = {FRAME_attack20, FRAME_attack40, boss2_frames_attack_rocket, boss2_run}; -static const mframe_t boss2_frames_pain_heavy [] = { +static const mframe_t boss2_frames_pain_heavy[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -320,7 +317,7 @@ static const mframe_t boss2_frames_pain_heavy [] = { }; const mmove_t boss2_move_pain_heavy = {FRAME_pain2, FRAME_pain19, boss2_frames_pain_heavy, boss2_run}; -static const mframe_t boss2_frames_pain_light [] = { +static const mframe_t boss2_frames_pain_light[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -328,7 +325,7 @@ static const mframe_t boss2_frames_pain_light [] = { }; const mmove_t boss2_move_pain_light = {FRAME_pain20, FRAME_pain23, boss2_frames_pain_light, boss2_run}; -static const mframe_t boss2_frames_death [] = { +static const mframe_t boss2_frames_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -433,7 +430,6 @@ void boss2_reattack_mg(edict_t *self) self->monsterinfo.currentmove = &boss2_move_attack_post_mg; } - void boss2_pain(edict_t *self, edict_t *other, float kick, int damage) { if (self->health < (self->max_health / 2)) @@ -504,7 +500,6 @@ bool Boss2_CheckAttack(edict_t *self) self->ideal_yaw = enemy_yaw; - // melee attack if (enemy_range == RANGE_MELEE) { if (self->monsterinfo.melee) @@ -552,8 +547,6 @@ bool Boss2_CheckAttack(edict_t *self) return false; } - - /*QUAKED monster_boss2 (1 .5 0) (-56 -56 0) (56 56 80) Ambush Trigger_Spawn Sight */ void SP_monster_boss2(edict_t *self) diff --git a/src/baseq2/m_boss31.c b/src/baseq2/m_boss31.c index c6d87df3c..3fdeae472 100644 --- a/src/baseq2/m_boss31.c +++ b/src/baseq2/m_boss31.c @@ -47,7 +47,6 @@ static int sound_death_hit; void BossExplode(edict_t *self); void MakronToss(edict_t *self); - void jorg_search(edict_t *self) { float r; @@ -62,7 +61,6 @@ void jorg_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search3, 1, ATTN_NORM, 0); } - void jorg_dead(edict_t *self); void jorgBFG(edict_t *self); void jorgMachineGun(edict_t *self); @@ -78,7 +76,7 @@ void jorg_death_hit(edict_t *self); // stand // -static const mframe_t jorg_frames_stand [] = { +static const mframe_t jorg_frames_stand[] = { { ai_stand, 0, jorg_idle }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -143,7 +141,6 @@ void jorg_death_hit(edict_t *self) gi.sound(self, CHAN_BODY, sound_death_hit, 1, ATTN_NORM, 0); } - void jorg_step_left(edict_t *self) { gi.sound(self, CHAN_BODY, sound_step_left, 1, ATTN_NORM, 0); @@ -154,13 +151,12 @@ void jorg_step_right(edict_t *self) gi.sound(self, CHAN_BODY, sound_step_right, 1, ATTN_NORM, 0); } - void jorg_stand(edict_t *self) { self->monsterinfo.currentmove = &jorg_move_stand; } -static const mframe_t jorg_frames_run [] = { +static const mframe_t jorg_frames_run[] = { { ai_run, 17, jorg_step_left }, { ai_run, 0, NULL }, { ai_run, 0, NULL }, @@ -182,7 +178,7 @@ const mmove_t jorg_move_run = {FRAME_walk06, FRAME_walk19, jorg_frames_run, NULL // walk // -static const mframe_t jorg_frames_start_walk [] = { +static const mframe_t jorg_frames_start_walk[] = { { ai_walk, 5, NULL }, { ai_walk, 6, NULL }, { ai_walk, 7, NULL }, @@ -191,7 +187,7 @@ static const mframe_t jorg_frames_start_walk [] = { }; const mmove_t jorg_move_start_walk = {FRAME_walk01, FRAME_walk05, jorg_frames_start_walk, NULL}; -static const mframe_t jorg_frames_walk [] = { +static const mframe_t jorg_frames_walk[] = { { ai_walk, 17, NULL }, { ai_walk, 0, NULL }, { ai_walk, 0, NULL }, @@ -209,7 +205,7 @@ static const mframe_t jorg_frames_walk [] = { }; const mmove_t jorg_move_walk = {FRAME_walk06, FRAME_walk19, jorg_frames_walk, NULL}; -static const mframe_t jorg_frames_end_walk [] = { +static const mframe_t jorg_frames_end_walk[] = { { ai_walk, 11, NULL }, { ai_walk, 0, NULL }, { ai_walk, 0, NULL }, @@ -232,7 +228,7 @@ void jorg_run(edict_t *self) self->monsterinfo.currentmove = &jorg_move_run; } -static const mframe_t jorg_frames_pain3 [] = { +static const mframe_t jorg_frames_pain3[] = { { ai_move, -28, NULL }, { ai_move, -6, NULL }, { ai_move, -3, jorg_step_left }, @@ -261,21 +257,21 @@ static const mframe_t jorg_frames_pain3 [] = { }; const mmove_t jorg_move_pain3 = {FRAME_pain301, FRAME_pain325, jorg_frames_pain3, jorg_run}; -static const mframe_t jorg_frames_pain2 [] = { +static const mframe_t jorg_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; const mmove_t jorg_move_pain2 = {FRAME_pain201, FRAME_pain203, jorg_frames_pain2, jorg_run}; -static const mframe_t jorg_frames_pain1 [] = { +static const mframe_t jorg_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL } }; const mmove_t jorg_move_pain1 = {FRAME_pain101, FRAME_pain103, jorg_frames_pain1, jorg_run}; -static const mframe_t jorg_frames_death1 [] = { +static const mframe_t jorg_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -329,7 +325,7 @@ static const mframe_t jorg_frames_death1 [] = { }; const mmove_t jorg_move_death = {FRAME_death01, FRAME_death50, jorg_frames_death1, jorg_dead}; -static const mframe_t jorg_frames_attack2 [] = { +static const mframe_t jorg_frames_attack2[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -346,7 +342,7 @@ static const mframe_t jorg_frames_attack2 [] = { }; const mmove_t jorg_move_attack2 = {FRAME_attak201, FRAME_attak213, jorg_frames_attack2, jorg_run}; -static const mframe_t jorg_frames_start_attack1 [] = { +static const mframe_t jorg_frames_start_attack1[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -425,12 +421,10 @@ void jorg_pain(edict_t *self, edict_t *other, float kick, int damage) if (random() <= 0.00005f) return; - if ((self->s.frame >= FRAME_attak201) && (self->s.frame <= FRAME_attak208)) if (random() <= 0.005f) return; - self->pain_debounce_framenum = level.framenum + 3 * BASE_FRAMERATE; if (skill->value == 3) return; // no pain anims in nightmare @@ -521,7 +515,6 @@ void jorg_dead(edict_t *self) { } - void jorg_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0); @@ -561,7 +554,6 @@ bool Jorg_CheckAttack(edict_t *self) self->ideal_yaw = enemy_yaw; - // melee attack if (enemy_range == RANGE_MELEE) { if (self->monsterinfo.melee) @@ -609,7 +601,6 @@ bool Jorg_CheckAttack(edict_t *self) return false; } - void MakronPrecache(void); /*QUAKED monster_jorg (1 .5 0) (-80 -80 0) (90 90 140) Ambush Trigger_Spawn Sight diff --git a/src/baseq2/m_boss32.c b/src/baseq2/m_boss32.c index a305b9b2f..f71ffb999 100644 --- a/src/baseq2/m_boss32.c +++ b/src/baseq2/m_boss32.c @@ -68,7 +68,7 @@ void makron_taunt(edict_t *self) // stand // -static const mframe_t makron_frames_stand [] = { +static const mframe_t makron_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -137,7 +137,7 @@ void makron_stand(edict_t *self) self->monsterinfo.currentmove = &makron_move_stand; } -static const mframe_t makron_frames_run [] = { +static const mframe_t makron_frames_run[] = { { ai_run, 3, makron_step_left }, { ai_run, 12, NULL }, { ai_run, 8, NULL }, @@ -181,7 +181,6 @@ void makron_prerailgun(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_prerailgun, 1, ATTN_NORM, 0); } - const mmove_t makron_move_walk = {FRAME_walk204, FRAME_walk213, makron_frames_run, NULL}; void makron_walk(edict_t *self) @@ -197,7 +196,7 @@ void makron_run(edict_t *self) self->monsterinfo.currentmove = &makron_move_run; } -static const mframe_t makron_frames_pain6 [] = { +static const mframe_t makron_frames_pain6[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -228,7 +227,7 @@ static const mframe_t makron_frames_pain6 [] = { }; const mmove_t makron_move_pain6 = {FRAME_pain601, FRAME_pain627, makron_frames_pain6, makron_run}; -static const mframe_t makron_frames_pain5 [] = { +static const mframe_t makron_frames_pain5[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -236,7 +235,7 @@ static const mframe_t makron_frames_pain5 [] = { }; const mmove_t makron_move_pain5 = {FRAME_pain501, FRAME_pain504, makron_frames_pain5, makron_run}; -static const mframe_t makron_frames_pain4 [] = { +static const mframe_t makron_frames_pain4[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -244,7 +243,7 @@ static const mframe_t makron_frames_pain4 [] = { }; const mmove_t makron_move_pain4 = {FRAME_pain401, FRAME_pain404, makron_frames_pain4, makron_run}; -static const mframe_t makron_frames_death2 [] = { +static const mframe_t makron_frames_death2[] = { { ai_move, -15, NULL }, { ai_move, 3, NULL }, { ai_move, -12, NULL }, @@ -343,7 +342,7 @@ static const mframe_t makron_frames_death2 [] = { }; const mmove_t makron_move_death2 = {FRAME_death201, FRAME_death295, makron_frames_death2, makron_dead}; -static const mframe_t makron_frames_death3 [] = { +static const mframe_t makron_frames_death3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -367,7 +366,7 @@ static const mframe_t makron_frames_death3 [] = { }; const mmove_t makron_move_death3 = {FRAME_death301, FRAME_death320, makron_frames_death3, NULL}; -static const mframe_t makron_frames_sight [] = { +static const mframe_t makron_frames_sight[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -402,8 +401,7 @@ void makronBFG(edict_t *self) monster_fire_bfg(self, start, dir, 50, 300, 100, 300, MZ2_MAKRON_BFG); } - -static const mframe_t makron_frames_attack3 [] = { +static const mframe_t makron_frames_attack3[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -522,7 +520,6 @@ void MakronHyperblaster(edict_t *self) monster_fire_blaster(self, start, forward, 15, 1000, MZ2_MAKRON_BLASTER_1, EF_BLASTER); } - void makron_pain(edict_t *self, edict_t *other, float kick, int damage) { @@ -541,7 +538,6 @@ void makron_pain(edict_t *self, edict_t *other, float kick, int damage) if (skill->value == 3) return; // no pain anims in nightmare - if (damage <= 40) { gi.sound(self, CHAN_VOICE, sound_pain4, 1, ATTN_NONE, 0); self->monsterinfo.currentmove = &makron_move_pain4; @@ -612,7 +608,6 @@ void makron_torso(edict_t *ent) gi.linkentity(ent); } - // // death // @@ -627,7 +622,6 @@ void makron_dead(edict_t *self) gi.linkentity(self); } - void makron_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { edict_t *tempent; @@ -694,7 +688,6 @@ bool Makron_CheckAttack(edict_t *self) self->ideal_yaw = enemy_yaw; - // melee attack if (enemy_range == RANGE_MELEE) { if (self->monsterinfo.melee) @@ -742,7 +735,6 @@ bool Makron_CheckAttack(edict_t *self) return false; } - // // monster_makron // @@ -808,7 +800,6 @@ void SP_monster_makron(edict_t *self) walkmonster_start(self); } - /* ================= MakronSpawn diff --git a/src/baseq2/m_brain.c b/src/baseq2/m_brain.c index 5f926d240..3a1c59318 100644 --- a/src/baseq2/m_brain.c +++ b/src/baseq2/m_brain.c @@ -26,7 +26,6 @@ brain #include "g_local.h" #include "m_brain.h" - static int sound_chest_open; static int sound_tentacles_extend; static int sound_tentacles_retract; @@ -42,7 +41,6 @@ static int sound_melee1; static int sound_melee2; static int sound_melee3; - void brain_sight(edict_t *self, edict_t *other) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); @@ -53,16 +51,14 @@ void brain_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } - void brain_run(edict_t *self); void brain_dead(edict_t *self); - // // STAND // -static const mframe_t brain_frames_stand [] = { +static const mframe_t brain_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -103,12 +99,11 @@ void brain_stand(edict_t *self) self->monsterinfo.currentmove = &brain_move_stand; } - // // IDLE // -static const mframe_t brain_frames_idle [] = { +static const mframe_t brain_frames_idle[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -150,11 +145,10 @@ void brain_idle(edict_t *self) self->monsterinfo.currentmove = &brain_move_idle; } - // // WALK // -static const mframe_t brain_frames_walk1 [] = { +static const mframe_t brain_frames_walk1[] = { { ai_walk, 7, NULL }, { ai_walk, 2, NULL }, { ai_walk, 3, NULL }, @@ -173,9 +167,7 @@ void brain_walk(edict_t *self) { self->monsterinfo.currentmove = &brain_move_walk1; } - - -static const mframe_t brain_frames_defense [] = +static const mframe_t brain_frames_defense[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -189,7 +181,7 @@ static const mframe_t brain_frames_defense [] = }; const mmove_t brain_move_defense = {FRAME_defens01, FRAME_defens08, brain_frames_defense, NULL}; -static const mframe_t brain_frames_pain3 [] = +static const mframe_t brain_frames_pain3[] = { { ai_move, -2, NULL }, { ai_move, 2, NULL }, @@ -200,7 +192,7 @@ static const mframe_t brain_frames_pain3 [] = }; const mmove_t brain_move_pain3 = {FRAME_pain301, FRAME_pain306, brain_frames_pain3, brain_run}; -static const mframe_t brain_frames_pain2 [] = +static const mframe_t brain_frames_pain2[] = { { ai_move, -2, NULL }, { ai_move, 0, NULL }, @@ -213,7 +205,7 @@ static const mframe_t brain_frames_pain2 [] = }; const mmove_t brain_move_pain2 = {FRAME_pain201, FRAME_pain208, brain_frames_pain2, brain_run}; -static const mframe_t brain_frames_pain1 [] = +static const mframe_t brain_frames_pain1[] = { { ai_move, -6, NULL }, { ai_move, -2, NULL }, @@ -239,7 +231,6 @@ static const mframe_t brain_frames_pain1 [] = }; const mmove_t brain_move_pain1 = {FRAME_pain101, FRAME_pain121, brain_frames_pain1, brain_run}; - // // DUCK // @@ -267,7 +258,7 @@ void brain_duck_up(edict_t *self) { gi.linkentity(self); } -static const mframe_t brain_frames_duck [] = +static const mframe_t brain_frames_duck[] = { { ai_move, 0, NULL }, { ai_move, -2, brain_duck_down }, @@ -291,8 +282,7 @@ void brain_dodge(edict_t *self, edict_t *attacker, float eta) { self->monsterinfo.currentmove = &brain_move_duck; } - -static const mframe_t brain_frames_death2 [] = +static const mframe_t brain_frames_death2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -302,7 +292,7 @@ static const mframe_t brain_frames_death2 [] = }; const mmove_t brain_move_death2 = {FRAME_death201, FRAME_death205, brain_frames_death2, brain_dead}; -static const mframe_t brain_frames_death1 [] = +static const mframe_t brain_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -325,7 +315,6 @@ static const mframe_t brain_frames_death1 [] = }; const mmove_t brain_move_death1 = {FRAME_death101, FRAME_death118, brain_frames_death1, brain_dead}; - // // MELEE // @@ -354,7 +343,7 @@ void brain_hit_left(edict_t *self) { gi.sound(self, CHAN_WEAPON, sound_melee3, 1, ATTN_NORM, 0); } -static const mframe_t brain_frames_attack1 [] = +static const mframe_t brain_frames_attack1[] = { { ai_charge, 8, NULL }, { ai_charge, 3, NULL }, @@ -400,7 +389,7 @@ void brain_chest_closed(edict_t *self) { } } -static const mframe_t brain_frames_attack2 [] = +static const mframe_t brain_frames_attack2[] = { { ai_charge, 5, NULL }, { ai_charge, -4, NULL }, @@ -429,12 +418,11 @@ void brain_melee(edict_t *self) { self->monsterinfo.currentmove = &brain_move_attack2; } - // // RUN // -static const mframe_t brain_frames_run [] = +static const mframe_t brain_frames_run[] = { { ai_run, 9, NULL }, { ai_run, 2, NULL }, @@ -458,7 +446,6 @@ void brain_run(edict_t *self) { self->monsterinfo.currentmove = &brain_move_run; } - void brain_pain(edict_t *self, edict_t *other, float kick, int damage) { float r; @@ -494,8 +481,6 @@ void brain_dead(edict_t *self) { gi.linkentity(self); } - - void brain_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; diff --git a/src/baseq2/m_chick.c b/src/baseq2/m_chick.c index 21070b46c..3cf243fcf 100644 --- a/src/baseq2/m_chick.c +++ b/src/baseq2/m_chick.c @@ -50,7 +50,6 @@ static int sound_pain3; static int sound_sight; static int sound_search; - void ChickMoan(edict_t *self) { if (random() < 0.5f) @@ -59,7 +58,7 @@ void ChickMoan(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle2, 1, ATTN_IDLE, 0); } -static const mframe_t chick_frames_fidget [] = { +static const mframe_t chick_frames_fidget[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -101,7 +100,7 @@ void chick_fidget(edict_t *self) self->monsterinfo.currentmove = &chick_move_fidget; } -static const mframe_t chick_frames_stand [] = { +static const mframe_t chick_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -141,7 +140,7 @@ void chick_stand(edict_t *self) self->monsterinfo.currentmove = &chick_move_stand; } -static const mframe_t chick_frames_start_run [] = { +static const mframe_t chick_frames_start_run[] = { { ai_run, 1, NULL }, { ai_run, 0, NULL }, { ai_run, 0, NULL }, @@ -155,7 +154,7 @@ static const mframe_t chick_frames_start_run [] = { }; const mmove_t chick_move_start_run = {FRAME_walk01, FRAME_walk10, chick_frames_start_run, chick_run}; -static const mframe_t chick_frames_run [] = { +static const mframe_t chick_frames_run[] = { { ai_run, 6, NULL }, { ai_run, 8, NULL }, { ai_run, 13, NULL }, @@ -171,7 +170,7 @@ static const mframe_t chick_frames_run [] = { const mmove_t chick_move_run = {FRAME_walk11, FRAME_walk20, chick_frames_run, NULL}; -static const mframe_t chick_frames_walk [] = { +static const mframe_t chick_frames_walk[] = { { ai_walk, 6, NULL }, { ai_walk, 8, NULL }, { ai_walk, 13, NULL }, @@ -206,7 +205,7 @@ void chick_run(edict_t *self) } } -static const mframe_t chick_frames_pain1 [] = { +static const mframe_t chick_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -215,7 +214,7 @@ static const mframe_t chick_frames_pain1 [] = { }; const mmove_t chick_move_pain1 = {FRAME_pain101, FRAME_pain105, chick_frames_pain1, chick_run}; -static const mframe_t chick_frames_pain2 [] = { +static const mframe_t chick_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -224,7 +223,7 @@ static const mframe_t chick_frames_pain2 [] = { }; const mmove_t chick_move_pain2 = {FRAME_pain201, FRAME_pain205, chick_frames_pain2, chick_run}; -static const mframe_t chick_frames_pain3 [] = { +static const mframe_t chick_frames_pain3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, -6, NULL }, @@ -290,7 +289,7 @@ void chick_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t chick_frames_death2 [] = { +static const mframe_t chick_frames_death2[] = { { ai_move, -6, NULL }, { ai_move, 0, NULL }, { ai_move, -1, NULL }, @@ -317,7 +316,7 @@ static const mframe_t chick_frames_death2 [] = { }; const mmove_t chick_move_death2 = {FRAME_death201, FRAME_death223, chick_frames_death2, chick_dead}; -static const mframe_t chick_frames_death1 [] = { +static const mframe_t chick_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, -7, NULL }, @@ -367,7 +366,6 @@ void chick_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, } } - void chick_duck_down(edict_t *self) { if (self->monsterinfo.aiflags & AI_DUCKED) @@ -395,7 +393,7 @@ void chick_duck_up(edict_t *self) gi.linkentity(self); } -static const mframe_t chick_frames_duck [] = { +static const mframe_t chick_frames_duck[] = { { ai_move, 0, chick_duck_down }, { ai_move, 1, NULL }, { ai_move, 4, chick_duck_hold }, @@ -426,7 +424,6 @@ void ChickSlash(edict_t *self) fire_hit(self, aim, (10 + (Q_rand() % 6)), 100); } - void ChickRocket(edict_t *self) { vec3_t forward, right; @@ -455,8 +452,7 @@ void ChickReload(edict_t *self) gi.sound(self, CHAN_VOICE, sound_missile_reload, 1, ATTN_NORM, 0); } - -static const mframe_t chick_frames_start_attack1 [] = { +static const mframe_t chick_frames_start_attack1[] = { { ai_charge, 0, Chick_PreAttack1 }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -473,8 +469,7 @@ static const mframe_t chick_frames_start_attack1 [] = { }; const mmove_t chick_move_start_attack1 = {FRAME_attak101, FRAME_attak113, chick_frames_start_attack1, NULL}; - -static const mframe_t chick_frames_attack1 [] = { +static const mframe_t chick_frames_attack1[] = { { ai_charge, 19, ChickRocket }, { ai_charge, -6, NULL }, { ai_charge, -5, NULL }, @@ -493,7 +488,7 @@ static const mframe_t chick_frames_attack1 [] = { }; const mmove_t chick_move_attack1 = {FRAME_attak114, FRAME_attak127, chick_frames_attack1, NULL}; -static const mframe_t chick_frames_end_attack1 [] = { +static const mframe_t chick_frames_end_attack1[] = { { ai_charge, -3, NULL }, { ai_charge, 0, NULL }, { ai_charge, -6, NULL }, @@ -520,7 +515,7 @@ void chick_attack1(edict_t *self) self->monsterinfo.currentmove = &chick_move_attack1; } -static const mframe_t chick_frames_slash [] = { +static const mframe_t chick_frames_slash[] = { { ai_charge, 1, NULL }, { ai_charge, 7, ChickSlash }, { ai_charge, -7, NULL }, @@ -533,7 +528,7 @@ static const mframe_t chick_frames_slash [] = { }; const mmove_t chick_move_slash = {FRAME_attak204, FRAME_attak212, chick_frames_slash, NULL}; -static const mframe_t chick_frames_end_slash [] = { +static const mframe_t chick_frames_end_slash[] = { { ai_charge, -6, NULL }, { ai_charge, -1, NULL }, { ai_charge, -6, NULL }, @@ -541,7 +536,6 @@ static const mframe_t chick_frames_end_slash [] = { }; const mmove_t chick_move_end_slash = {FRAME_attak213, FRAME_attak216, chick_frames_end_slash, chick_run}; - void chick_reslash(edict_t *self) { if (self->enemy->health > 0) { @@ -563,22 +557,18 @@ void chick_slash(edict_t *self) self->monsterinfo.currentmove = &chick_move_slash; } - -static const mframe_t chick_frames_start_slash [] = { +static const mframe_t chick_frames_start_slash[] = { { ai_charge, 1, NULL }, { ai_charge, 8, NULL }, { ai_charge, 3, NULL } }; const mmove_t chick_move_start_slash = {FRAME_attak201, FRAME_attak203, chick_frames_start_slash, chick_slash}; - - void chick_melee(edict_t *self) { self->monsterinfo.currentmove = &chick_move_start_slash; } - void chick_attack(edict_t *self) { self->monsterinfo.currentmove = &chick_move_start_attack1; diff --git a/src/baseq2/m_flipper.c b/src/baseq2/m_flipper.c index ec488a431..1a63e0c84 100644 --- a/src/baseq2/m_flipper.c +++ b/src/baseq2/m_flipper.c @@ -26,7 +26,6 @@ FLIPPER #include "g_local.h" #include "m_flipper.h" - static int sound_chomp; static int sound_attack; static int sound_pain1; @@ -36,10 +35,9 @@ static int sound_idle; static int sound_search; static int sound_sight; - void flipper_stand(edict_t *self); -static const mframe_t flipper_frames_stand [] = { +static const mframe_t flipper_frames_stand[] = { { ai_stand, 0, NULL } }; @@ -52,7 +50,7 @@ void flipper_stand(edict_t *self) #define FLIPPER_RUN_SPEED 24 -static const mframe_t flipper_frames_run [] = { +static const mframe_t flipper_frames_run[] = { { ai_run, FLIPPER_RUN_SPEED, NULL }, // 6 { ai_run, FLIPPER_RUN_SPEED, NULL }, { ai_run, FLIPPER_RUN_SPEED, NULL }, @@ -87,7 +85,7 @@ void flipper_run_loop(edict_t *self) self->monsterinfo.currentmove = &flipper_move_run_loop; } -static const mframe_t flipper_frames_run_start [] = { +static const mframe_t flipper_frames_run_start[] = { { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, NULL }, @@ -103,7 +101,7 @@ void flipper_run(edict_t *self) } /* Standard Swimming */ -static const mframe_t flipper_frames_walk [] = { +static const mframe_t flipper_frames_walk[] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -136,7 +134,7 @@ void flipper_walk(edict_t *self) self->monsterinfo.currentmove = &flipper_move_walk; } -static const mframe_t flipper_frames_start_run [] = { +static const mframe_t flipper_frames_start_run[] = { { ai_run, 8, NULL }, { ai_run, 8, NULL }, { ai_run, 8, NULL }, @@ -150,7 +148,7 @@ void flipper_start_run(edict_t *self) self->monsterinfo.currentmove = &flipper_move_start_run; } -static const mframe_t flipper_frames_pain2 [] = { +static const mframe_t flipper_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -159,7 +157,7 @@ static const mframe_t flipper_frames_pain2 [] = { }; const mmove_t flipper_move_pain2 = {FRAME_flppn101, FRAME_flppn105, flipper_frames_pain2, flipper_run}; -static const mframe_t flipper_frames_pain1 [] = { +static const mframe_t flipper_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -181,7 +179,7 @@ void flipper_preattack(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_chomp, 1, ATTN_NORM, 0); } -static const mframe_t flipper_frames_attack [] = { +static const mframe_t flipper_frames_attack[] = { { ai_charge, 0, flipper_preattack }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -245,7 +243,7 @@ void flipper_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t flipper_frames_death [] = { +static const mframe_t flipper_frames_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, diff --git a/src/baseq2/m_float.c b/src/baseq2/m_float.c index 8a4221a4b..e91d4316b 100644 --- a/src/baseq2/m_float.c +++ b/src/baseq2/m_float.c @@ -26,7 +26,6 @@ floater #include "g_local.h" #include "m_float.h" - static int sound_attack2; static int sound_attack3; static int sound_death1; @@ -35,7 +34,6 @@ static int sound_pain1; static int sound_pain2; static int sound_sight; - void floater_sight(edict_t *self, edict_t *other) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); @@ -46,7 +44,6 @@ void floater_idle(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0); } - //void floater_stand1 (edict_t *self); void floater_dead(edict_t *self); void floater_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point); @@ -54,7 +51,6 @@ void floater_run(edict_t *self); void floater_wham(edict_t *self); void floater_zap(edict_t *self); - void floater_fire_blaster(edict_t *self) { vec3_t start; @@ -77,8 +73,7 @@ void floater_fire_blaster(edict_t *self) monster_fire_blaster(self, start, dir, 1, 1000, MZ2_FLOAT_BLASTER_1, effect); } - -static const mframe_t floater_frames_stand1 [] = { +static const mframe_t floater_frames_stand1[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -134,7 +129,7 @@ static const mframe_t floater_frames_stand1 [] = { }; const mmove_t floater_move_stand1 = {FRAME_stand101, FRAME_stand152, floater_frames_stand1, NULL}; -static const mframe_t floater_frames_stand2 [] = { +static const mframe_t floater_frames_stand2[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -198,7 +193,7 @@ void floater_stand(edict_t *self) self->monsterinfo.currentmove = &floater_move_stand2; } -static const mframe_t floater_frames_activate [] = { +static const mframe_t floater_frames_activate[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -232,7 +227,7 @@ static const mframe_t floater_frames_activate [] = { }; const mmove_t floater_move_activate = {FRAME_actvat01, FRAME_actvat31, floater_frames_activate, NULL}; -static const mframe_t floater_frames_attack1 [] = { +static const mframe_t floater_frames_attack1[] = { { ai_charge, 0, NULL }, // Blaster attack { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -250,7 +245,7 @@ static const mframe_t floater_frames_attack1 [] = { }; const mmove_t floater_move_attack1 = {FRAME_attak101, FRAME_attak114, floater_frames_attack1, floater_run}; -static const mframe_t floater_frames_attack2 [] = { +static const mframe_t floater_frames_attack2[] = { { ai_charge, 0, NULL }, // Claws { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -279,7 +274,7 @@ static const mframe_t floater_frames_attack2 [] = { }; const mmove_t floater_move_attack2 = {FRAME_attak201, FRAME_attak225, floater_frames_attack2, floater_run}; -static const mframe_t floater_frames_attack3 [] = { +static const mframe_t floater_frames_attack3[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -317,7 +312,7 @@ static const mframe_t floater_frames_attack3 [] = { }; const mmove_t floater_move_attack3 = {FRAME_attak301, FRAME_attak334, floater_frames_attack3, floater_run}; -static const mframe_t floater_frames_death [] = { +static const mframe_t floater_frames_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -334,7 +329,7 @@ static const mframe_t floater_frames_death [] = { }; const mmove_t floater_move_death = {FRAME_death01, FRAME_death13, floater_frames_death, floater_dead}; -static const mframe_t floater_frames_pain1 [] = { +static const mframe_t floater_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -345,7 +340,7 @@ static const mframe_t floater_frames_pain1 [] = { }; const mmove_t floater_move_pain1 = {FRAME_pain101, FRAME_pain107, floater_frames_pain1, floater_run}; -static const mframe_t floater_frames_pain2 [] = { +static const mframe_t floater_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -357,7 +352,7 @@ static const mframe_t floater_frames_pain2 [] = { }; const mmove_t floater_move_pain2 = {FRAME_pain201, FRAME_pain208, floater_frames_pain2, floater_run}; -static const mframe_t floater_frames_pain3 [] = { +static const mframe_t floater_frames_pain3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -373,7 +368,7 @@ static const mframe_t floater_frames_pain3 [] = { }; const mmove_t floater_move_pain3 = {FRAME_pain301, FRAME_pain312, floater_frames_pain3, floater_run}; -static const mframe_t floater_frames_walk [] = { +static const mframe_t floater_frames_walk[] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, @@ -429,7 +424,7 @@ static const mframe_t floater_frames_walk [] = { }; const mmove_t floater_move_walk = {FRAME_stand101, FRAME_stand152, floater_frames_walk, NULL}; -static const mframe_t floater_frames_run [] = { +static const mframe_t floater_frames_run[] = { { ai_run, 13, NULL }, { ai_run, 13, NULL }, { ai_run, 13, NULL }, @@ -539,7 +534,6 @@ void floater_attack(edict_t *self) self->monsterinfo.currentmove = &floater_move_attack1; } - void floater_melee(edict_t *self) { if (random() < 0.5f) @@ -548,7 +542,6 @@ void floater_melee(edict_t *self) self->monsterinfo.currentmove = &floater_move_attack2; } - void floater_pain(edict_t *self, edict_t *other, float kick, int damage) { int n; diff --git a/src/baseq2/m_flyer.c b/src/baseq2/m_flyer.c index dab5a29e3..c9c00f15b 100644 --- a/src/baseq2/m_flyer.c +++ b/src/baseq2/m_flyer.c @@ -38,7 +38,6 @@ static int sound_slash; static int sound_sproing; static int sound_die; - void flyer_check_melee(edict_t *self); void flyer_loop_melee(edict_t *self); void flyer_melee(edict_t *self); @@ -46,7 +45,6 @@ void flyer_setstart(edict_t *self); void flyer_stand(edict_t *self); void flyer_nextmove(edict_t *self); - void flyer_sight(edict_t *self, edict_t *other) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); @@ -62,8 +60,7 @@ void flyer_pop_blades(edict_t *self) gi.sound(self, CHAN_VOICE, sound_sproing, 1, ATTN_NORM, 0); } - -static const mframe_t flyer_frames_stand [] = { +static const mframe_t flyer_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -112,8 +109,7 @@ static const mframe_t flyer_frames_stand [] = { }; const mmove_t flyer_move_stand = {FRAME_stand01, FRAME_stand45, flyer_frames_stand, NULL}; - -static const mframe_t flyer_frames_walk [] = { +static const mframe_t flyer_frames_walk[] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, @@ -162,7 +158,7 @@ static const mframe_t flyer_frames_walk [] = { }; const mmove_t flyer_move_walk = {FRAME_stand01, FRAME_stand45, flyer_frames_walk, NULL}; -static const mframe_t flyer_frames_run [] = { +static const mframe_t flyer_frames_run[] = { { ai_run, 10, NULL }, { ai_run, 10, NULL }, { ai_run, 10, NULL }, @@ -229,7 +225,7 @@ void flyer_stand(edict_t *self) self->monsterinfo.currentmove = &flyer_move_stand; } -static const mframe_t flyer_frames_start [] = { +static const mframe_t flyer_frames_start[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -239,7 +235,7 @@ static const mframe_t flyer_frames_start [] = { }; const mmove_t flyer_move_start = {FRAME_start01, FRAME_start06, flyer_frames_start, NULL}; -static const mframe_t flyer_frames_stop [] = { +static const mframe_t flyer_frames_stop[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -260,8 +256,7 @@ void flyer_start(edict_t *self) self->monsterinfo.currentmove = &flyer_move_start; } - -static const mframe_t flyer_frames_rollright [] = { +static const mframe_t flyer_frames_rollright[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -274,7 +269,7 @@ static const mframe_t flyer_frames_rollright [] = { }; const mmove_t flyer_move_rollright = {FRAME_rollr01, FRAME_rollr09, flyer_frames_rollright, NULL}; -static const mframe_t flyer_frames_rollleft [] = { +static const mframe_t flyer_frames_rollleft[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -287,7 +282,7 @@ static const mframe_t flyer_frames_rollleft [] = { }; const mmove_t flyer_move_rollleft = {FRAME_rollf01, FRAME_rollf09, flyer_frames_rollleft, NULL}; -static const mframe_t flyer_frames_pain3 [] = { +static const mframe_t flyer_frames_pain3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -295,7 +290,7 @@ static const mframe_t flyer_frames_pain3 [] = { }; const mmove_t flyer_move_pain3 = {FRAME_pain301, FRAME_pain304, flyer_frames_pain3, flyer_run}; -static const mframe_t flyer_frames_pain2 [] = { +static const mframe_t flyer_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -303,7 +298,7 @@ static const mframe_t flyer_frames_pain2 [] = { }; const mmove_t flyer_move_pain2 = {FRAME_pain201, FRAME_pain204, flyer_frames_pain2, flyer_run}; -static const mframe_t flyer_frames_pain1 [] = { +static const mframe_t flyer_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -316,7 +311,7 @@ static const mframe_t flyer_frames_pain1 [] = { }; const mmove_t flyer_move_pain1 = {FRAME_pain101, FRAME_pain109, flyer_frames_pain1, flyer_run}; -static const mframe_t flyer_frames_defense [] = { +static const mframe_t flyer_frames_defense[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, // Hold this frame @@ -326,7 +321,7 @@ static const mframe_t flyer_frames_defense [] = { }; const mmove_t flyer_move_defense = {FRAME_defens01, FRAME_defens06, flyer_frames_defense, NULL}; -static const mframe_t flyer_frames_bankright [] = { +static const mframe_t flyer_frames_bankright[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -337,7 +332,7 @@ static const mframe_t flyer_frames_bankright [] = { }; const mmove_t flyer_move_bankright = {FRAME_bankr01, FRAME_bankr07, flyer_frames_bankright, NULL}; -static const mframe_t flyer_frames_bankleft [] = { +static const mframe_t flyer_frames_bankleft[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -348,7 +343,6 @@ static const mframe_t flyer_frames_bankleft [] = { }; const mmove_t flyer_move_bankleft = {FRAME_bankl01, FRAME_bankl07, flyer_frames_bankleft, NULL}; - void flyer_fire(edict_t *self, int flash_number) { vec3_t start; @@ -381,8 +375,7 @@ void flyer_fireright(edict_t *self) flyer_fire(self, MZ2_FLYER_BLASTER_2); } - -static const mframe_t flyer_frames_attack2 [] = { +static const mframe_t flyer_frames_attack2[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -403,7 +396,6 @@ static const mframe_t flyer_frames_attack2 [] = { }; const mmove_t flyer_move_attack2 = {FRAME_attak201, FRAME_attak217, flyer_frames_attack2, flyer_run}; - void flyer_slash_left(edict_t *self) { vec3_t aim; @@ -422,7 +414,7 @@ void flyer_slash_right(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_slash, 1, ATTN_NORM, 0); } -static const mframe_t flyer_frames_start_melee [] = { +static const mframe_t flyer_frames_start_melee[] = { { ai_charge, 0, flyer_pop_blades }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -432,15 +424,14 @@ static const mframe_t flyer_frames_start_melee [] = { }; const mmove_t flyer_move_start_melee = {FRAME_attak101, FRAME_attak106, flyer_frames_start_melee, flyer_loop_melee}; -static const mframe_t flyer_frames_end_melee [] = { +static const mframe_t flyer_frames_end_melee[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL } }; const mmove_t flyer_move_end_melee = {FRAME_attak119, FRAME_attak121, flyer_frames_end_melee, flyer_run}; - -static const mframe_t flyer_frames_loop_melee [] = { +static const mframe_t flyer_frames_loop_melee[] = { { ai_charge, 0, NULL }, // Loop Start { ai_charge, 0, NULL }, { ai_charge, 0, flyer_slash_left }, // Left Wing Strike @@ -462,8 +453,6 @@ void flyer_loop_melee(edict_t *self) self->monsterinfo.currentmove = &flyer_move_loop_melee; } - - void flyer_attack(edict_t *self) { self->monsterinfo.currentmove = &flyer_move_attack2; @@ -530,14 +519,12 @@ void flyer_pain(edict_t *self, edict_t *other, float kick, int damage) } } - void flyer_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { gi.sound(self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0); BecomeExplosion1(self); } - /*QUAKED monster_flyer (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight */ void SP_monster_flyer(edict_t *self) diff --git a/src/baseq2/m_gladiator.c b/src/baseq2/m_gladiator.c index 815866157..99b1acc0c 100644 --- a/src/baseq2/m_gladiator.c +++ b/src/baseq2/m_gladiator.c @@ -26,7 +26,6 @@ GLADIATOR #include "g_local.h" #include "m_gladiator.h" - static int sound_pain1; static int sound_pain2; static int sound_die; @@ -38,7 +37,6 @@ static int sound_idle; static int sound_search; static int sound_sight; - void gladiator_idle(edict_t *self) { gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0); @@ -59,7 +57,7 @@ void gladiator_cleaver_swing(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0); } -static const mframe_t gladiator_frames_stand [] = { +static const mframe_t gladiator_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -75,8 +73,7 @@ void gladiator_stand(edict_t *self) self->monsterinfo.currentmove = &gladiator_move_stand; } - -static const mframe_t gladiator_frames_walk [] = { +static const mframe_t gladiator_frames_walk[] = { { ai_walk, 15, NULL }, { ai_walk, 7, NULL }, { ai_walk, 6, NULL }, @@ -101,8 +98,7 @@ void gladiator_walk(edict_t *self) self->monsterinfo.currentmove = &gladiator_move_walk; } - -static const mframe_t gladiator_frames_run [] = { +static const mframe_t gladiator_frames_run[] = { { ai_run, 23, NULL }, { ai_run, 14, NULL }, { ai_run, 14, NULL }, @@ -120,7 +116,6 @@ void gladiator_run(edict_t *self) self->monsterinfo.currentmove = &gladiator_move_run; } - void GaldiatorMelee(edict_t *self) { vec3_t aim; @@ -132,7 +127,7 @@ void GaldiatorMelee(edict_t *self) gi.sound(self, CHAN_AUTO, sound_cleaver_miss, 1, ATTN_NORM, 0); } -static const mframe_t gladiator_frames_attack_melee [] = { +static const mframe_t gladiator_frames_attack_melee[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -158,7 +153,6 @@ void gladiator_melee(edict_t *self) self->monsterinfo.currentmove = &gladiator_move_attack_melee; } - void GladiatorGun(edict_t *self) { vec3_t start; @@ -175,7 +169,7 @@ void GladiatorGun(edict_t *self) monster_fire_railgun(self, start, dir, 50, 100, MZ2_GLADIATOR_RAILGUN_1); } -static const mframe_t gladiator_frames_attack_gun [] = { +static const mframe_t gladiator_frames_attack_gun[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -206,8 +200,7 @@ void gladiator_attack(edict_t *self) self->monsterinfo.currentmove = &gladiator_move_attack_gun; } - -static const mframe_t gladiator_frames_pain [] = { +static const mframe_t gladiator_frames_pain[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -217,7 +210,7 @@ static const mframe_t gladiator_frames_pain [] = { }; const mmove_t gladiator_move_pain = {FRAME_pain1, FRAME_pain6, gladiator_frames_pain, gladiator_run}; -static const mframe_t gladiator_frames_pain_air [] = { +static const mframe_t gladiator_frames_pain_air[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -257,7 +250,6 @@ void gladiator_pain(edict_t *self, edict_t *other, float kick, int damage) } - void gladiator_dead(edict_t *self) { VectorSet(self->mins, -16, -16, -24); @@ -268,7 +260,7 @@ void gladiator_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t gladiator_frames_death [] = { +static const mframe_t gladiator_frames_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -321,7 +313,6 @@ void gladiator_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int dam self->monsterinfo.currentmove = &gladiator_move_death; } - /*QUAKED monster_gladiator (1 .5 0) (-32 -32 -24) (32 32 64) Ambush Trigger_Spawn Sight */ void SP_monster_gladiator(edict_t *self) @@ -331,7 +322,6 @@ void SP_monster_gladiator(edict_t *self) return; } - sound_pain1 = gi.soundindex("gladiator/pain.wav"); sound_pain2 = gi.soundindex("gladiator/gldpain2.wav"); sound_die = gi.soundindex("gladiator/glddeth2.wav"); diff --git a/src/baseq2/m_gunner.c b/src/baseq2/m_gunner.c index 01784f188..ba70980d4 100644 --- a/src/baseq2/m_gunner.c +++ b/src/baseq2/m_gunner.c @@ -26,7 +26,6 @@ GUNNER #include "g_local.h" #include "m_gunner.h" - static int sound_pain; static int sound_pain2; static int sound_death; @@ -35,7 +34,6 @@ static int sound_open; static int sound_search; static int sound_sight; - void gunner_idlesound(edict_t *self) { gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0); @@ -51,17 +49,15 @@ void gunner_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } - bool visible(edict_t *self, edict_t *other); void GunnerGrenade(edict_t *self); void GunnerFire(edict_t *self); void gunner_fire_chain(edict_t *self); void gunner_refire_chain(edict_t *self); - void gunner_stand(edict_t *self); -static const mframe_t gunner_frames_fidget [] = { +static const mframe_t gunner_frames_fidget[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -126,7 +122,7 @@ void gunner_fidget(edict_t *self) self->monsterinfo.currentmove = &gunner_move_fidget; } -static const mframe_t gunner_frames_stand [] = { +static const mframe_t gunner_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -167,8 +163,7 @@ void gunner_stand(edict_t *self) self->monsterinfo.currentmove = &gunner_move_stand; } - -static const mframe_t gunner_frames_walk [] = { +static const mframe_t gunner_frames_walk[] = { { ai_walk, 0, NULL }, { ai_walk, 3, NULL }, { ai_walk, 4, NULL }, @@ -190,7 +185,7 @@ void gunner_walk(edict_t *self) self->monsterinfo.currentmove = &gunner_move_walk; } -static const mframe_t gunner_frames_run [] = { +static const mframe_t gunner_frames_run[] = { { ai_run, 26, NULL }, { ai_run, 9, NULL }, { ai_run, 9, NULL }, @@ -211,7 +206,7 @@ void gunner_run(edict_t *self) self->monsterinfo.currentmove = &gunner_move_run; } -static const mframe_t gunner_frames_runandshoot [] = { +static const mframe_t gunner_frames_runandshoot[] = { { ai_run, 32, NULL }, { ai_run, 15, NULL }, { ai_run, 10, NULL }, @@ -227,7 +222,7 @@ void gunner_runandshoot(edict_t *self) self->monsterinfo.currentmove = &gunner_move_runandshoot; } -static const mframe_t gunner_frames_pain3 [] = { +static const mframe_t gunner_frames_pain3[] = { { ai_move, -3, NULL }, { ai_move, 1, NULL }, { ai_move, 1, NULL }, @@ -236,7 +231,7 @@ static const mframe_t gunner_frames_pain3 [] = { }; const mmove_t gunner_move_pain3 = {FRAME_pain301, FRAME_pain305, gunner_frames_pain3, gunner_run}; -static const mframe_t gunner_frames_pain2 [] = { +static const mframe_t gunner_frames_pain2[] = { { ai_move, -2, NULL }, { ai_move, 11, NULL }, { ai_move, 6, NULL }, @@ -248,7 +243,7 @@ static const mframe_t gunner_frames_pain2 [] = { }; const mmove_t gunner_move_pain2 = {FRAME_pain201, FRAME_pain208, gunner_frames_pain2, gunner_run}; -static const mframe_t gunner_frames_pain1 [] = { +static const mframe_t gunner_frames_pain1[] = { { ai_move, 2, NULL }, { ai_move, 0, NULL }, { ai_move, -5, NULL }, @@ -306,7 +301,7 @@ void gunner_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t gunner_frames_death [] = { +static const mframe_t gunner_frames_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -347,7 +342,6 @@ void gunner_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage self->monsterinfo.currentmove = &gunner_move_death; } - void gunner_duck_down(edict_t *self) { if (self->monsterinfo.aiflags & AI_DUCKED) @@ -380,7 +374,7 @@ void gunner_duck_up(edict_t *self) gi.linkentity(self); } -static const mframe_t gunner_frames_duck [] = { +static const mframe_t gunner_frames_duck[] = { { ai_move, 1, gunner_duck_down }, { ai_move, 1, NULL }, { ai_move, 1, gunner_duck_hold }, @@ -403,7 +397,6 @@ void gunner_dodge(edict_t *self, edict_t *attacker, float eta) self->monsterinfo.currentmove = &gunner_move_duck; } - void gunner_opengun(edict_t *self) { gi.sound(self, CHAN_VOICE, sound_open, 1, ATTN_IDLE, 0); @@ -457,7 +450,7 @@ void GunnerGrenade(edict_t *self) monster_fire_grenade(self, start, aim, 50, 600, flash_number); } -static const mframe_t gunner_frames_attack_chain [] = { +static const mframe_t gunner_frames_attack_chain[] = { { ai_charge, 0, gunner_opengun }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -468,7 +461,7 @@ static const mframe_t gunner_frames_attack_chain [] = { }; const mmove_t gunner_move_attack_chain = {FRAME_attak209, FRAME_attak215, gunner_frames_attack_chain, gunner_fire_chain}; -static const mframe_t gunner_frames_fire_chain [] = { +static const mframe_t gunner_frames_fire_chain[] = { { ai_charge, 0, GunnerFire }, { ai_charge, 0, GunnerFire }, { ai_charge, 0, GunnerFire }, @@ -480,7 +473,7 @@ static const mframe_t gunner_frames_fire_chain [] = { }; const mmove_t gunner_move_fire_chain = {FRAME_attak216, FRAME_attak223, gunner_frames_fire_chain, gunner_refire_chain}; -static const mframe_t gunner_frames_endfire_chain [] = { +static const mframe_t gunner_frames_endfire_chain[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -491,7 +484,7 @@ static const mframe_t gunner_frames_endfire_chain [] = { }; const mmove_t gunner_move_endfire_chain = {FRAME_attak224, FRAME_attak230, gunner_frames_endfire_chain, gunner_run}; -static const mframe_t gunner_frames_attack_grenade [] = { +static const mframe_t gunner_frames_attack_grenade[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, diff --git a/src/baseq2/m_hover.c b/src/baseq2/m_hover.c index 78f944de1..74eb340fa 100644 --- a/src/baseq2/m_hover.c +++ b/src/baseq2/m_hover.c @@ -28,7 +28,6 @@ hover bool visible(edict_t *self, edict_t *other); - static int sound_pain1; static int sound_pain2; static int sound_death1; @@ -37,7 +36,6 @@ static int sound_sight; static int sound_search1; static int sound_search2; - void hover_sight(edict_t *self, edict_t *other) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); @@ -51,7 +49,6 @@ void hover_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search2, 1, ATTN_NORM, 0); } - void hover_run(edict_t *self); void hover_stand(edict_t *self); void hover_dead(edict_t *self); @@ -60,7 +57,7 @@ void hover_reattack(edict_t *self); void hover_fire_blaster(edict_t *self); void hover_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point); -static const mframe_t hover_frames_stand [] = { +static const mframe_t hover_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -94,7 +91,7 @@ static const mframe_t hover_frames_stand [] = { }; const mmove_t hover_move_stand = {FRAME_stand01, FRAME_stand30, hover_frames_stand, NULL}; -static const mframe_t hover_frames_stop1 [] = { +static const mframe_t hover_frames_stop1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -107,7 +104,7 @@ static const mframe_t hover_frames_stop1 [] = { }; const mmove_t hover_move_stop1 = {FRAME_stop101, FRAME_stop109, hover_frames_stop1, NULL}; -static const mframe_t hover_frames_stop2 [] = { +static const mframe_t hover_frames_stop2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -119,7 +116,7 @@ static const mframe_t hover_frames_stop2 [] = { }; const mmove_t hover_move_stop2 = {FRAME_stop201, FRAME_stop208, hover_frames_stop2, NULL}; -static const mframe_t hover_frames_takeoff [] = { +static const mframe_t hover_frames_takeoff[] = { { ai_move, 0, NULL }, { ai_move, -2, NULL }, { ai_move, 5, NULL }, @@ -153,7 +150,7 @@ static const mframe_t hover_frames_takeoff [] = { }; const mmove_t hover_move_takeoff = {FRAME_takeof01, FRAME_takeof30, hover_frames_takeoff, NULL}; -static const mframe_t hover_frames_pain3 [] = { +static const mframe_t hover_frames_pain3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -166,7 +163,7 @@ static const mframe_t hover_frames_pain3 [] = { }; const mmove_t hover_move_pain3 = {FRAME_pain301, FRAME_pain309, hover_frames_pain3, hover_run}; -static const mframe_t hover_frames_pain2 [] = { +static const mframe_t hover_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -182,7 +179,7 @@ static const mframe_t hover_frames_pain2 [] = { }; const mmove_t hover_move_pain2 = {FRAME_pain201, FRAME_pain212, hover_frames_pain2, hover_run}; -static const mframe_t hover_frames_pain1 [] = { +static const mframe_t hover_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 2, NULL }, @@ -214,12 +211,12 @@ static const mframe_t hover_frames_pain1 [] = { }; const mmove_t hover_move_pain1 = {FRAME_pain101, FRAME_pain128, hover_frames_pain1, hover_run}; -static const mframe_t hover_frames_land [] = { +static const mframe_t hover_frames_land[] = { { ai_move, 0, NULL } }; const mmove_t hover_move_land = {FRAME_land01, FRAME_land01, hover_frames_land, NULL}; -static const mframe_t hover_frames_forward [] = { +static const mframe_t hover_frames_forward[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -258,7 +255,7 @@ static const mframe_t hover_frames_forward [] = { }; const mmove_t hover_move_forward = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_forward, NULL}; -static const mframe_t hover_frames_walk [] = { +static const mframe_t hover_frames_walk[] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -297,7 +294,7 @@ static const mframe_t hover_frames_walk [] = { }; const mmove_t hover_move_walk = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_walk, NULL}; -static const mframe_t hover_frames_run [] = { +static const mframe_t hover_frames_run[] = { { ai_run, 10, NULL }, { ai_run, 10, NULL }, { ai_run, 10, NULL }, @@ -336,7 +333,7 @@ static const mframe_t hover_frames_run [] = { }; const mmove_t hover_move_run = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_run, NULL}; -static const mframe_t hover_frames_death1 [] = { +static const mframe_t hover_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -351,7 +348,7 @@ static const mframe_t hover_frames_death1 [] = { }; const mmove_t hover_move_death1 = {FRAME_death101, FRAME_death111, hover_frames_death1, hover_dead}; -static const mframe_t hover_frames_backward [] = { +static const mframe_t hover_frames_backward[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -379,22 +376,21 @@ static const mframe_t hover_frames_backward [] = { }; const mmove_t hover_move_backward = {FRAME_backwd01, FRAME_backwd24, hover_frames_backward, NULL}; -static const mframe_t hover_frames_start_attack [] = { +static const mframe_t hover_frames_start_attack[] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL }, { ai_charge, 1, NULL } }; const mmove_t hover_move_start_attack = {FRAME_attak101, FRAME_attak103, hover_frames_start_attack, hover_attack}; -static const mframe_t hover_frames_attack1 [] = { +static const mframe_t hover_frames_attack1[] = { { ai_charge, -10, hover_fire_blaster }, { ai_charge, -10, hover_fire_blaster }, { ai_charge, 0, hover_reattack }, }; const mmove_t hover_move_attack1 = {FRAME_attak104, FRAME_attak106, hover_frames_attack1, NULL}; - -static const mframe_t hover_frames_end_attack [] = { +static const mframe_t hover_frames_end_attack[] = { { ai_charge, 1, NULL }, { ai_charge, 1, NULL } }; @@ -411,7 +407,6 @@ void hover_reattack(edict_t *self) self->monsterinfo.currentmove = &hover_move_end_attack; } - void hover_fire_blaster(edict_t *self) { vec3_t start; @@ -435,7 +430,6 @@ void hover_fire_blaster(edict_t *self) monster_fire_blaster(self, start, dir, 1, 1000, MZ2_HOVER_BLASTER_1, effect); } - void hover_stand(edict_t *self) { self->monsterinfo.currentmove = &hover_move_stand; @@ -464,7 +458,6 @@ void hover_attack(edict_t *self) self->monsterinfo.currentmove = &hover_move_attack1; } - void hover_pain(edict_t *self, edict_t *other, float kick, int damage) { if (self->health < (self->max_health / 2)) diff --git a/src/baseq2/m_infantry.c b/src/baseq2/m_infantry.c index de80a0075..b2bad416c 100644 --- a/src/baseq2/m_infantry.c +++ b/src/baseq2/m_infantry.c @@ -28,7 +28,6 @@ INFANTRY void InfantryMachineGun(edict_t *self); - static int sound_pain1; static int sound_pain2; static int sound_die1; @@ -42,8 +41,7 @@ static int sound_sight; static int sound_search; static int sound_idle; - -static const mframe_t infantry_frames_stand [] = { +static const mframe_t infantry_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -74,8 +72,7 @@ void infantry_stand(edict_t *self) self->monsterinfo.currentmove = &infantry_move_stand; } - -static const mframe_t infantry_frames_fidget [] = { +static const mframe_t infantry_frames_fidget[] = { { ai_stand, 1, NULL }, { ai_stand, 0, NULL }, { ai_stand, 1, NULL }, @@ -134,7 +131,7 @@ void infantry_fidget(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0); } -static const mframe_t infantry_frames_walk [] = { +static const mframe_t infantry_frames_walk[] = { { ai_walk, 5, NULL }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -155,7 +152,7 @@ void infantry_walk(edict_t *self) self->monsterinfo.currentmove = &infantry_move_walk; } -static const mframe_t infantry_frames_run [] = { +static const mframe_t infantry_frames_run[] = { { ai_run, 10, NULL }, { ai_run, 20, NULL }, { ai_run, 5, NULL }, @@ -175,8 +172,7 @@ void infantry_run(edict_t *self) self->monsterinfo.currentmove = &infantry_move_run; } - -static const mframe_t infantry_frames_pain1 [] = { +static const mframe_t infantry_frames_pain1[] = { { ai_move, -3, NULL }, { ai_move, -2, NULL }, { ai_move, -1, NULL }, @@ -190,7 +186,7 @@ static const mframe_t infantry_frames_pain1 [] = { }; const mmove_t infantry_move_pain1 = {FRAME_pain101, FRAME_pain110, infantry_frames_pain1, infantry_run}; -static const mframe_t infantry_frames_pain2 [] = { +static const mframe_t infantry_frames_pain2[] = { { ai_move, -3, NULL }, { ai_move, -3, NULL }, { ai_move, 0, NULL }, @@ -229,7 +225,6 @@ void infantry_pain(edict_t *self, edict_t *other, float kick, int damage) } } - static const vec3_t aimangles[] = { { 0.0, 5.0, 0.0 }, { 10.0, 15.0, 0.0 }, @@ -294,7 +289,7 @@ void infantry_dead(edict_t *self) M_FlyCheck(self); } -static const mframe_t infantry_frames_death1 [] = { +static const mframe_t infantry_frames_death1[] = { { ai_move, -4, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -319,7 +314,7 @@ static const mframe_t infantry_frames_death1 [] = { const mmove_t infantry_move_death1 = {FRAME_death101, FRAME_death120, infantry_frames_death1, infantry_dead}; // Off with his head -static const mframe_t infantry_frames_death2 [] = { +static const mframe_t infantry_frames_death2[] = { { ai_move, 0, NULL }, { ai_move, 1, NULL }, { ai_move, 5, NULL }, @@ -348,7 +343,7 @@ static const mframe_t infantry_frames_death2 [] = { }; const mmove_t infantry_move_death2 = {FRAME_death201, FRAME_death225, infantry_frames_death2, infantry_dead}; -static const mframe_t infantry_frames_death3 [] = { +static const mframe_t infantry_frames_death3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -361,7 +356,6 @@ static const mframe_t infantry_frames_death3 [] = { }; const mmove_t infantry_move_death3 = {FRAME_death301, FRAME_death309, infantry_frames_death3, infantry_dead}; - void infantry_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; @@ -398,7 +392,6 @@ void infantry_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int dama } } - void infantry_duck_down(edict_t *self) { if (self->monsterinfo.aiflags & AI_DUCKED) @@ -426,7 +419,7 @@ void infantry_duck_up(edict_t *self) gi.linkentity(self); } -static const mframe_t infantry_frames_duck [] = { +static const mframe_t infantry_frames_duck[] = { { ai_move, -2, infantry_duck_down }, { ai_move, -5, infantry_duck_hold }, { ai_move, 3, NULL }, @@ -446,7 +439,6 @@ void infantry_dodge(edict_t *self, edict_t *attacker, float eta) self->monsterinfo.currentmove = &infantry_move_duck; } - void infantry_cock_gun(edict_t *self) { int n; @@ -466,7 +458,7 @@ void infantry_fire(edict_t *self) self->monsterinfo.aiflags |= AI_HOLD_FRAME; } -static const mframe_t infantry_frames_attack1 [] = { +static const mframe_t infantry_frames_attack1[] = { { ai_charge, 4, NULL }, { ai_charge, -1, NULL }, { ai_charge, -1, NULL }, @@ -485,7 +477,6 @@ static const mframe_t infantry_frames_attack1 [] = { }; const mmove_t infantry_move_attack1 = {FRAME_attak101, FRAME_attak115, infantry_frames_attack1, infantry_run}; - void infantry_swing(edict_t *self) { gi.sound(self, CHAN_WEAPON, sound_punch_swing, 1, ATTN_NORM, 0); @@ -500,7 +491,7 @@ void infantry_smack(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_punch_hit, 1, ATTN_NORM, 0); } -static const mframe_t infantry_frames_attack2 [] = { +static const mframe_t infantry_frames_attack2[] = { { ai_charge, 3, NULL }, { ai_charge, 6, NULL }, { ai_charge, 0, infantry_swing }, @@ -520,7 +511,6 @@ void infantry_attack(edict_t *self) self->monsterinfo.currentmove = &infantry_move_attack1; } - /*QUAKED monster_infantry (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight */ void SP_monster_infantry(edict_t *self) @@ -544,7 +534,6 @@ void SP_monster_infantry(edict_t *self) sound_search = gi.soundindex("infantry/infsrch1.wav"); sound_idle = gi.soundindex("infantry/infidle1.wav"); - self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; self->s.modelindex = gi.modelindex("models/monsters/infantry/tris.md2"); diff --git a/src/baseq2/m_insane.c b/src/baseq2/m_insane.c index 469c8e91b..130a87bed 100644 --- a/src/baseq2/m_insane.c +++ b/src/baseq2/m_insane.c @@ -26,7 +26,6 @@ insane #include "g_local.h" #include "m_insane.h" - static int sound_fist; static int sound_shake; static int sound_moan; @@ -52,7 +51,6 @@ void insane_scream(edict_t *self) gi.sound(self, CHAN_VOICE, sound_scream[Q_rand() % 8], 1, ATTN_IDLE, 0); } - void insane_stand(edict_t *self); void insane_dead(edict_t *self); void insane_cross(edict_t *self); @@ -62,8 +60,7 @@ void insane_checkdown(edict_t *self); void insane_checkup(edict_t *self); void insane_onground(edict_t *self); - -static const mframe_t insane_frames_stand_normal [] = { +static const mframe_t insane_frames_stand_normal[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -73,7 +70,7 @@ static const mframe_t insane_frames_stand_normal [] = { }; const mmove_t insane_move_stand_normal = {FRAME_stand60, FRAME_stand65, insane_frames_stand_normal, insane_stand}; -static const mframe_t insane_frames_stand_insane [] = { +static const mframe_t insane_frames_stand_insane[] = { { ai_stand, 0, insane_shake }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -107,7 +104,7 @@ static const mframe_t insane_frames_stand_insane [] = { }; const mmove_t insane_move_stand_insane = {FRAME_stand65, FRAME_stand94, insane_frames_stand_insane, insane_stand}; -static const mframe_t insane_frames_uptodown [] = { +static const mframe_t insane_frames_uptodown[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -154,8 +151,7 @@ static const mframe_t insane_frames_uptodown [] = { }; const mmove_t insane_move_uptodown = {FRAME_stand1, FRAME_stand40, insane_frames_uptodown, insane_onground}; - -static const mframe_t insane_frames_downtoup [] = { +static const mframe_t insane_frames_downtoup[] = { { ai_move, -0.7, NULL }, // 41 { ai_move, -1.2, NULL }, // 42 { ai_move, -1.5, NULL }, // 43 @@ -178,7 +174,7 @@ static const mframe_t insane_frames_downtoup [] = { }; const mmove_t insane_move_downtoup = {FRAME_stand41, FRAME_stand59, insane_frames_downtoup, insane_stand}; -static const mframe_t insane_frames_jumpdown [] = { +static const mframe_t insane_frames_jumpdown[] = { { ai_move, 0.2, NULL }, { ai_move, 11.5, NULL }, { ai_move, 5.1, NULL }, @@ -187,8 +183,7 @@ static const mframe_t insane_frames_jumpdown [] = { }; const mmove_t insane_move_jumpdown = {FRAME_stand96, FRAME_stand100, insane_frames_jumpdown, insane_onground}; - -static const mframe_t insane_frames_down [] = { +static const mframe_t insane_frames_down[] = { { ai_move, 0, NULL }, // 100 { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -253,7 +248,7 @@ static const mframe_t insane_frames_down [] = { }; const mmove_t insane_move_down = {FRAME_stand100, FRAME_stand160, insane_frames_down, insane_onground}; -static const mframe_t insane_frames_walk_normal [] = { +static const mframe_t insane_frames_walk_normal[] = { { ai_walk, 0, insane_scream }, { ai_walk, 2.5, NULL }, { ai_walk, 3.5, NULL }, @@ -271,7 +266,7 @@ static const mframe_t insane_frames_walk_normal [] = { const mmove_t insane_move_walk_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_walk}; const mmove_t insane_move_run_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_run}; -static const mframe_t insane_frames_walk_insane [] = { +static const mframe_t insane_frames_walk_insane[] = { { ai_walk, 0, insane_scream }, // walk 1 { ai_walk, 3.4, NULL }, // walk 2 { ai_walk, 3.6, NULL }, // 3 @@ -302,7 +297,7 @@ static const mframe_t insane_frames_walk_insane [] = { const mmove_t insane_move_walk_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_walk}; const mmove_t insane_move_run_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_run}; -static const mframe_t insane_frames_stand_pain [] = { +static const mframe_t insane_frames_stand_pain[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -317,7 +312,7 @@ static const mframe_t insane_frames_stand_pain [] = { }; const mmove_t insane_move_stand_pain = {FRAME_st_pain2, FRAME_st_pain12, insane_frames_stand_pain, insane_run}; -static const mframe_t insane_frames_stand_death [] = { +static const mframe_t insane_frames_stand_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -338,7 +333,7 @@ static const mframe_t insane_frames_stand_death [] = { }; const mmove_t insane_move_stand_death = {FRAME_st_death2, FRAME_st_death18, insane_frames_stand_death, insane_dead}; -static const mframe_t insane_frames_crawl [] = { +static const mframe_t insane_frames_crawl[] = { { ai_walk, 0, insane_scream }, { ai_walk, 1.5, NULL }, { ai_walk, 2.1, NULL }, @@ -352,7 +347,7 @@ static const mframe_t insane_frames_crawl [] = { const mmove_t insane_move_crawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL}; const mmove_t insane_move_runcrawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL}; -static const mframe_t insane_frames_crawl_pain [] = { +static const mframe_t insane_frames_crawl_pain[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -365,7 +360,7 @@ static const mframe_t insane_frames_crawl_pain [] = { }; const mmove_t insane_move_crawl_pain = {FRAME_cr_pain2, FRAME_cr_pain10, insane_frames_crawl_pain, insane_run}; -static const mframe_t insane_frames_crawl_death [] = { +static const mframe_t insane_frames_crawl_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -376,7 +371,7 @@ static const mframe_t insane_frames_crawl_death [] = { }; const mmove_t insane_move_crawl_death = {FRAME_cr_death10, FRAME_cr_death16, insane_frames_crawl_death, insane_dead}; -static const mframe_t insane_frames_cross [] = { +static const mframe_t insane_frames_cross[] = { { ai_move, 0, insane_moan }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -395,7 +390,7 @@ static const mframe_t insane_frames_cross [] = { }; const mmove_t insane_move_cross = {FRAME_cross1, FRAME_cross15, insane_frames_cross, insane_cross}; -static const mframe_t insane_frames_struggle_cross [] = { +static const mframe_t insane_frames_struggle_cross[] = { { ai_move, 0, insane_scream }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -452,7 +447,6 @@ void insane_run(edict_t *self) self->monsterinfo.currentmove = &insane_move_run_insane; } - void insane_pain(edict_t *self, edict_t *other, float kick, int damage) { int l, r; @@ -549,7 +543,6 @@ void insane_dead(edict_t *self) gi.linkentity(self); } - void insane_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; @@ -583,7 +576,6 @@ void insane_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage } } - /*QUAKED misc_insane (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn CRAWL CRUCIFIED STAND_GROUND ALWAYS_STAND */ void SP_misc_insane(edict_t *self) diff --git a/src/baseq2/m_medic.c b/src/baseq2/m_medic.c index 0c021ecc4..a79456f87 100644 --- a/src/baseq2/m_medic.c +++ b/src/baseq2/m_medic.c @@ -28,7 +28,6 @@ MEDIC bool visible(edict_t *self, edict_t *other); - static int sound_idle1; static int sound_pain1; static int sound_pain2; @@ -40,7 +39,6 @@ static int sound_hook_hit; static int sound_hook_heal; static int sound_hook_retract; - edict_t *medic_FindDeadMonster(edict_t *self) { edict_t *ent = NULL; @@ -111,8 +109,7 @@ void medic_sight(edict_t *self, edict_t *other) gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } - -static const mframe_t medic_frames_stand [] = { +static const mframe_t medic_frames_stand[] = { { ai_stand, 0, medic_idle }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -212,8 +209,7 @@ void medic_stand(edict_t *self) self->monsterinfo.currentmove = &medic_move_stand; } - -static const mframe_t medic_frames_walk [] = { +static const mframe_t medic_frames_walk[] = { { ai_walk, 6.2, NULL }, { ai_walk, 18.1, NULL }, { ai_walk, 1, NULL }, @@ -234,8 +230,7 @@ void medic_walk(edict_t *self) self->monsterinfo.currentmove = &medic_move_walk; } - -static const mframe_t medic_frames_run [] = { +static const mframe_t medic_frames_run[] = { { ai_run, 18, NULL }, { ai_run, 22.5, NULL }, { ai_run, 25.4, NULL }, @@ -268,8 +263,7 @@ void medic_run(edict_t *self) self->monsterinfo.currentmove = &medic_move_run; } - -static const mframe_t medic_frames_pain1 [] = { +static const mframe_t medic_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -281,7 +275,7 @@ static const mframe_t medic_frames_pain1 [] = { }; const mmove_t medic_move_pain1 = {FRAME_paina1, FRAME_paina8, medic_frames_pain1, medic_run}; -static const mframe_t medic_frames_pain2 [] = { +static const mframe_t medic_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -347,7 +341,6 @@ void medic_fire_blaster(edict_t *self) monster_fire_blaster(self, start, dir, 2, 1000, MZ2_MEDIC_BLASTER_1, effect); } - void medic_dead(edict_t *self) { VectorSet(self->mins, -16, -16, -24); @@ -358,7 +351,7 @@ void medic_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t medic_frames_death [] = { +static const mframe_t medic_frames_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -423,7 +416,6 @@ void medic_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, self->monsterinfo.currentmove = &medic_move_death; } - void medic_duck_down(edict_t *self) { if (self->monsterinfo.aiflags & AI_DUCKED) @@ -451,7 +443,7 @@ void medic_duck_up(edict_t *self) gi.linkentity(self); } -static const mframe_t medic_frames_duck [] = { +static const mframe_t medic_frames_duck[] = { { ai_move, -1, NULL }, { ai_move, -1, NULL }, { ai_move, -1, medic_duck_down }, @@ -482,7 +474,7 @@ void medic_dodge(edict_t *self, edict_t *attacker, float eta) self->monsterinfo.currentmove = &medic_move_duck; } -static const mframe_t medic_frames_attackHyperBlaster [] = { +static const mframe_t medic_frames_attackHyperBlaster[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -502,7 +494,6 @@ static const mframe_t medic_frames_attackHyperBlaster [] = { }; const mmove_t medic_move_attackHyperBlaster = {FRAME_attack15, FRAME_attack30, medic_frames_attackHyperBlaster, medic_run}; - void medic_continue(edict_t *self) { if (visible(self, self->enemy)) @@ -510,8 +501,7 @@ void medic_continue(edict_t *self) self->monsterinfo.currentmove = &medic_move_attackHyperBlaster; } - -static const mframe_t medic_frames_attackBlaster [] = { +static const mframe_t medic_frames_attackBlaster[] = { { ai_charge, 0, NULL }, { ai_charge, 5, NULL }, { ai_charge, 5, NULL }, @@ -529,7 +519,6 @@ static const mframe_t medic_frames_attackBlaster [] = { }; const mmove_t medic_move_attackBlaster = {FRAME_attack1, FRAME_attack14, medic_frames_attackBlaster, medic_run}; - void medic_hook_launch(edict_t *self) { gi.sound(self, CHAN_WEAPON, sound_hook_launch, 1, ATTN_NORM, 0); @@ -629,7 +618,7 @@ void medic_hook_retract(edict_t *self) self->enemy->monsterinfo.aiflags &= ~AI_RESURRECTING; } -static const mframe_t medic_frames_attackCable [] = { +static const mframe_t medic_frames_attackCable[] = { { ai_move, 2, NULL }, { ai_move, 3, NULL }, { ai_move, 5, NULL }, @@ -661,7 +650,6 @@ static const mframe_t medic_frames_attackCable [] = { }; const mmove_t medic_move_attackCable = {FRAME_attack33, FRAME_attack60, medic_frames_attackCable, medic_run}; - void medic_attack(edict_t *self) { if (self->monsterinfo.aiflags & AI_MEDIC) @@ -680,7 +668,6 @@ bool medic_checkattack(edict_t *self) return M_CheckAttack(self); } - /*QUAKED monster_medic (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight */ void SP_monster_medic(edict_t *self) diff --git a/src/baseq2/m_move.c b/src/baseq2/m_move.c index 7442a02e0..2ee04150e 100644 --- a/src/baseq2/m_move.c +++ b/src/baseq2/m_move.c @@ -46,8 +46,8 @@ bool M_CheckBottom(edict_t *ent) // with the tougher checks // the corners must be within 16 of the midpoint start[2] = mins[2] - 1; - for (x = 0 ; x <= 1 ; x++) - for (y = 0 ; y <= 1 ; y++) { + for (x = 0; x <= 1; x++) + for (y = 0; y <= 1; y++) { start[0] = x ? maxs[0] : mins[0]; start[1] = y ? maxs[1] : mins[1]; if (gi.pointcontents(start) != CONTENTS_SOLID) @@ -75,8 +75,8 @@ bool M_CheckBottom(edict_t *ent) mid = bottom = trace.endpos[2]; // the corners must be within 16 of the midpoint - for (x = 0 ; x <= 1 ; x++) - for (y = 0 ; y <= 1 ; y++) { + for (x = 0; x <= 1; x++) + for (y = 0; y <= 1; y++) { start[0] = stop[0] = x ? maxs[0] : mins[0]; start[1] = stop[1] = y ? maxs[1] : mins[1]; @@ -92,7 +92,6 @@ bool M_CheckBottom(edict_t *ent) return true; } - /* ============= SV_movestep @@ -122,7 +121,7 @@ bool SV_movestep(edict_t *ent, vec3_t move, bool relink) // flying monsters don't step up if (ent->flags & (FL_SWIM | FL_FLY)) { // try one move with vertical motion, then one without - for (i = 0 ; i < 2 ; i++) { + for (i = 0; i < 2; i++) { VectorAdd(ent->s.origin, move, neworg); if (i == 0 && ent->enemy) { if (!ent->goalentity) @@ -209,7 +208,6 @@ bool SV_movestep(edict_t *ent, vec3_t move, bool relink) return false; } - // don't go in to water if (ent->waterlevel == 0) { test[0] = trace.endpos[0]; @@ -267,7 +265,6 @@ bool SV_movestep(edict_t *ent, vec3_t move, bool relink) return true; } - //============================================================================ /* @@ -309,7 +306,6 @@ void M_ChangeYaw(edict_t *ent) ent->s.angles[YAW] = anglemod(current + move); } - /* ====================== SV_StepDirection @@ -359,8 +355,6 @@ void SV_FixCheckBottom(edict_t *ent) ent->flags |= FL_PARTIALGROUND; } - - /* ================ SV_NewChaseDir @@ -428,11 +422,11 @@ void SV_NewChaseDir(edict_t *actor, edict_t *enemy, float dist) return; if (Q_rand() & 1) { /*randomly determine direction of search*/ - for (tdir = 0 ; tdir <= 315 ; tdir += 45) + for (tdir = 0; tdir <= 315; tdir += 45) if (tdir != turnaround && SV_StepDirection(actor, tdir, dist)) return; } else { - for (tdir = 315 ; tdir >= 0 ; tdir -= 45) + for (tdir = 315; tdir >= 0; tdir -= 45) if (tdir != turnaround && SV_StepDirection(actor, tdir, dist)) return; } @@ -459,7 +453,7 @@ bool SV_CloseEnough(edict_t *ent, edict_t *goal, float dist) { int i; - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { if (goal->absmin[i] > ent->absmax[i] + dist) return false; if (goal->absmax[i] < ent->absmin[i] - dist) @@ -468,7 +462,6 @@ bool SV_CloseEnough(edict_t *ent, edict_t *goal, float dist) return true; } - /* ====================== M_MoveToGoal @@ -494,7 +487,6 @@ void M_MoveToGoal(edict_t *ent, float dist) } } - /* =============== M_walkmove diff --git a/src/baseq2/m_mutant.c b/src/baseq2/m_mutant.c index 352e6818b..5b94fcaad 100644 --- a/src/baseq2/m_mutant.c +++ b/src/baseq2/m_mutant.c @@ -26,7 +26,6 @@ mutant #include "g_local.h" #include "m_mutant.h" - static int sound_swing; static int sound_hit; static int sound_hit2; @@ -72,12 +71,11 @@ void mutant_swing(edict_t *self) gi.sound(self, CHAN_VOICE, sound_swing, 1, ATTN_NORM, 0); } - // // STAND // -static const mframe_t mutant_frames_stand [] = { +static const mframe_t mutant_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -142,7 +140,6 @@ void mutant_stand(edict_t *self) self->monsterinfo.currentmove = &mutant_move_stand; } - // // IDLE // @@ -153,7 +150,7 @@ void mutant_idle_loop(edict_t *self) self->monsterinfo.nextframe = FRAME_stand155; } -static const mframe_t mutant_frames_idle [] = { +static const mframe_t mutant_frames_idle[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -176,14 +173,13 @@ void mutant_idle(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0); } - // // WALK // void mutant_walk(edict_t *self); -static const mframe_t mutant_frames_walk [] = { +static const mframe_t mutant_frames_walk[] = { { ai_walk, 3, NULL }, { ai_walk, 1, NULL }, { ai_walk, 5, NULL }, @@ -204,7 +200,7 @@ void mutant_walk_loop(edict_t *self) self->monsterinfo.currentmove = &mutant_move_walk; } -static const mframe_t mutant_frames_start_walk [] = { +static const mframe_t mutant_frames_start_walk[] = { { ai_walk, 5, NULL }, { ai_walk, 5, NULL }, { ai_walk, -2, NULL }, @@ -217,12 +213,11 @@ void mutant_walk(edict_t *self) self->monsterinfo.currentmove = &mutant_move_start_walk; } - // // RUN // -static const mframe_t mutant_frames_run [] = { +static const mframe_t mutant_frames_run[] = { { ai_run, 40, NULL }, { ai_run, 40, mutant_step }, { ai_run, 24, NULL }, @@ -240,7 +235,6 @@ void mutant_run(edict_t *self) self->monsterinfo.currentmove = &mutant_move_run; } - // // MELEE // @@ -276,7 +270,7 @@ void mutant_check_refire(edict_t *self) self->monsterinfo.nextframe = FRAME_attack09; } -static const mframe_t mutant_frames_attack [] = { +static const mframe_t mutant_frames_attack[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, mutant_hit_left }, @@ -292,7 +286,6 @@ void mutant_melee(edict_t *self) self->monsterinfo.currentmove = &mutant_move_attack; } - // // ATTACK // @@ -359,7 +352,7 @@ void mutant_check_landing(edict_t *self) self->monsterinfo.nextframe = FRAME_attack05; } -static const mframe_t mutant_frames_jump [] = { +static const mframe_t mutant_frames_jump[] = { { ai_charge, 0, NULL }, { ai_charge, 17, NULL }, { ai_charge, 15, mutant_jump_takeoff }, @@ -376,7 +369,6 @@ void mutant_jump(edict_t *self) self->monsterinfo.currentmove = &mutant_move_jump; } - // // CHECKATTACK // @@ -433,12 +425,11 @@ bool mutant_checkattack(edict_t *self) return false; } - // // PAIN // -static const mframe_t mutant_frames_pain1 [] = { +static const mframe_t mutant_frames_pain1[] = { { ai_move, 4, NULL }, { ai_move, -3, NULL }, { ai_move, -8, NULL }, @@ -447,7 +438,7 @@ static const mframe_t mutant_frames_pain1 [] = { }; const mmove_t mutant_move_pain1 = {FRAME_pain101, FRAME_pain105, mutant_frames_pain1, mutant_run}; -static const mframe_t mutant_frames_pain2 [] = { +static const mframe_t mutant_frames_pain2[] = { { ai_move, -24, NULL }, { ai_move, 11, NULL }, { ai_move, 5, NULL }, @@ -457,7 +448,7 @@ static const mframe_t mutant_frames_pain2 [] = { }; const mmove_t mutant_move_pain2 = {FRAME_pain201, FRAME_pain206, mutant_frames_pain2, mutant_run}; -static const mframe_t mutant_frames_pain3 [] = { +static const mframe_t mutant_frames_pain3[] = { { ai_move, -22, NULL }, { ai_move, 3, NULL }, { ai_move, 3, NULL }, @@ -500,7 +491,6 @@ void mutant_pain(edict_t *self, edict_t *other, float kick, int damage) } } - // // DEATH // @@ -516,7 +506,7 @@ void mutant_dead(edict_t *self) M_FlyCheck(self); } -static const mframe_t mutant_frames_death1 [] = { +static const mframe_t mutant_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -529,7 +519,7 @@ static const mframe_t mutant_frames_death1 [] = { }; const mmove_t mutant_move_death1 = {FRAME_death101, FRAME_death109, mutant_frames_death1, mutant_dead}; -static const mframe_t mutant_frames_death2 [] = { +static const mframe_t mutant_frames_death2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -572,7 +562,6 @@ void mutant_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage self->monsterinfo.currentmove = &mutant_move_death2; } - // // SPAWN // diff --git a/src/baseq2/m_parasite.c b/src/baseq2/m_parasite.c index ef280a353..45ac48859 100644 --- a/src/baseq2/m_parasite.c +++ b/src/baseq2/m_parasite.c @@ -26,7 +26,6 @@ parasite #include "g_local.h" #include "m_parasite.h" - static int sound_pain1; static int sound_pain2; static int sound_die; @@ -39,7 +38,6 @@ static int sound_tap; static int sound_scratch; static int sound_search; - void parasite_stand(edict_t *self); void parasite_start_run(edict_t *self); void parasite_run(edict_t *self); @@ -49,7 +47,6 @@ void parasite_end_fidget(edict_t *self); void parasite_do_fidget(edict_t *self); void parasite_refidget(edict_t *self); - void parasite_launch(edict_t *self) { gi.sound(self, CHAN_WEAPON, sound_launch, 1, ATTN_NORM, 0); @@ -80,8 +77,7 @@ void parasite_search(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_search, 1, ATTN_IDLE, 0); } - -static const mframe_t parasite_frames_start_fidget [] = { +static const mframe_t parasite_frames_start_fidget[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -89,7 +85,7 @@ static const mframe_t parasite_frames_start_fidget [] = { }; const mmove_t parasite_move_start_fidget = {FRAME_stand18, FRAME_stand21, parasite_frames_start_fidget, parasite_do_fidget}; -static const mframe_t parasite_frames_fidget [] = { +static const mframe_t parasite_frames_fidget[] = { { ai_stand, 0, parasite_scratch }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -99,7 +95,7 @@ static const mframe_t parasite_frames_fidget [] = { }; const mmove_t parasite_move_fidget = {FRAME_stand22, FRAME_stand27, parasite_frames_fidget, parasite_refidget}; -static const mframe_t parasite_frames_end_fidget [] = { +static const mframe_t parasite_frames_end_fidget[] = { { ai_stand, 0, parasite_scratch }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -134,8 +130,7 @@ void parasite_idle(edict_t *self) self->monsterinfo.currentmove = ¶site_move_start_fidget; } - -static const mframe_t parasite_frames_stand [] = { +static const mframe_t parasite_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, parasite_tap }, @@ -161,8 +156,7 @@ void parasite_stand(edict_t *self) self->monsterinfo.currentmove = ¶site_move_stand; } - -static const mframe_t parasite_frames_run [] = { +static const mframe_t parasite_frames_run[] = { { ai_run, 30, NULL }, { ai_run, 30, NULL }, { ai_run, 22, NULL }, @@ -173,13 +167,13 @@ static const mframe_t parasite_frames_run [] = { }; const mmove_t parasite_move_run = {FRAME_run03, FRAME_run09, parasite_frames_run, NULL}; -static const mframe_t parasite_frames_start_run [] = { +static const mframe_t parasite_frames_start_run[] = { { ai_run, 0, NULL }, { ai_run, 30, NULL }, }; const mmove_t parasite_move_start_run = {FRAME_run01, FRAME_run02, parasite_frames_start_run, parasite_run}; -static const mframe_t parasite_frames_stop_run [] = { +static const mframe_t parasite_frames_stop_run[] = { { ai_run, 20, NULL }, { ai_run, 20, NULL }, { ai_run, 12, NULL }, @@ -205,8 +199,7 @@ void parasite_run(edict_t *self) self->monsterinfo.currentmove = ¶site_move_run; } - -static const mframe_t parasite_frames_walk [] = { +static const mframe_t parasite_frames_walk[] = { { ai_walk, 30, NULL }, { ai_walk, 30, NULL }, { ai_walk, 22, NULL }, @@ -217,13 +210,13 @@ static const mframe_t parasite_frames_walk [] = { }; const mmove_t parasite_move_walk = {FRAME_run03, FRAME_run09, parasite_frames_walk, parasite_walk}; -static const mframe_t parasite_frames_start_walk [] = { +static const mframe_t parasite_frames_start_walk[] = { { ai_walk, 0, NULL }, { ai_walk, 30, parasite_walk } }; const mmove_t parasite_move_start_walk = {FRAME_run01, FRAME_run02, parasite_frames_start_walk, NULL}; -static const mframe_t parasite_frames_stop_walk [] = { +static const mframe_t parasite_frames_stop_walk[] = { { ai_walk, 20, NULL }, { ai_walk, 20, NULL }, { ai_walk, 12, NULL }, @@ -243,8 +236,7 @@ void parasite_walk(edict_t *self) self->monsterinfo.currentmove = ¶site_move_walk; } - -static const mframe_t parasite_frames_pain1 [] = { +static const mframe_t parasite_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -280,7 +272,6 @@ void parasite_pain(edict_t *self, edict_t *other, float kick, int damage) self->monsterinfo.currentmove = ¶site_move_pain1; } - static bool parasite_drain_attack_ok(vec3_t start, vec3_t end) { vec3_t dir, angles; @@ -345,7 +336,7 @@ void parasite_drain_attack(edict_t *self) T_Damage(self->enemy, self, self, dir, self->enemy->s.origin, vec3_origin, damage, 0, DAMAGE_NO_KNOCKBACK, MOD_UNKNOWN); } -static const mframe_t parasite_frames_drain [] = { +static const mframe_t parasite_frames_drain[] = { { ai_charge, 0, parasite_launch }, { ai_charge, 0, NULL }, { ai_charge, 15, parasite_drain_attack }, // Target hits @@ -372,8 +363,6 @@ void parasite_attack(edict_t *self) self->monsterinfo.currentmove = ¶site_move_drain; } - - /* === Death Stuff Starts @@ -390,7 +379,7 @@ void parasite_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t parasite_frames_death [] = { +static const mframe_t parasite_frames_death[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, diff --git a/src/baseq2/m_soldier.c b/src/baseq2/m_soldier.c index 4f567af4d..58f3f0226 100644 --- a/src/baseq2/m_soldier.c +++ b/src/baseq2/m_soldier.c @@ -26,7 +26,6 @@ SOLDIER #include "g_local.h" #include "m_soldier.h" - static int sound_idle; static int sound_sight1; static int sound_sight2; @@ -38,7 +37,6 @@ static int sound_death; static int sound_death_ss; static int sound_cock; - void soldier_idle(edict_t *self) { if (random() > 0.8f) @@ -53,12 +51,11 @@ void soldier_cock(edict_t *self) gi.sound(self, CHAN_WEAPON, sound_cock, 1, ATTN_NORM, 0); } - // STAND void soldier_stand(edict_t *self); -static const mframe_t soldier_frames_stand1 [] = { +static const mframe_t soldier_frames_stand1[] = { { ai_stand, 0, soldier_idle }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -94,7 +91,7 @@ static const mframe_t soldier_frames_stand1 [] = { }; const mmove_t soldier_move_stand1 = {FRAME_stand101, FRAME_stand130, soldier_frames_stand1, soldier_stand}; -static const mframe_t soldier_frames_stand3 [] = { +static const mframe_t soldier_frames_stand3[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -148,7 +145,6 @@ void soldier_stand(edict_t *self) self->monsterinfo.currentmove = &soldier_move_stand3; } - // // WALK // @@ -159,7 +155,7 @@ void soldier_walk1_random(edict_t *self) self->monsterinfo.nextframe = FRAME_walk101; } -static const mframe_t soldier_frames_walk1 [] = { +static const mframe_t soldier_frames_walk1[] = { { ai_walk, 3, NULL }, { ai_walk, 6, NULL }, { ai_walk, 2, NULL }, @@ -196,7 +192,7 @@ static const mframe_t soldier_frames_walk1 [] = { }; const mmove_t soldier_move_walk1 = {FRAME_walk101, FRAME_walk133, soldier_frames_walk1, NULL}; -static const mframe_t soldier_frames_walk2 [] = { +static const mframe_t soldier_frames_walk2[] = { { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, { ai_walk, 9, NULL }, @@ -218,20 +214,19 @@ void soldier_walk(edict_t *self) self->monsterinfo.currentmove = &soldier_move_walk2; } - // // RUN // void soldier_run(edict_t *self); -static const mframe_t soldier_frames_start_run [] = { +static const mframe_t soldier_frames_start_run[] = { { ai_run, 7, NULL }, { ai_run, 5, NULL } }; const mmove_t soldier_move_start_run = {FRAME_run01, FRAME_run02, soldier_frames_start_run, soldier_run}; -static const mframe_t soldier_frames_run [] = { +static const mframe_t soldier_frames_run[] = { { ai_run, 10, NULL }, { ai_run, 11, NULL }, { ai_run, 11, NULL }, @@ -257,12 +252,11 @@ void soldier_run(edict_t *self) } } - // // PAIN // -static const mframe_t soldier_frames_pain1 [] = { +static const mframe_t soldier_frames_pain1[] = { { ai_move, -3, NULL }, { ai_move, 4, NULL }, { ai_move, 1, NULL }, @@ -271,7 +265,7 @@ static const mframe_t soldier_frames_pain1 [] = { }; const mmove_t soldier_move_pain1 = {FRAME_pain101, FRAME_pain105, soldier_frames_pain1, soldier_run}; -static const mframe_t soldier_frames_pain2 [] = { +static const mframe_t soldier_frames_pain2[] = { { ai_move, -13, NULL }, { ai_move, -1, NULL }, { ai_move, 2, NULL }, @@ -282,7 +276,7 @@ static const mframe_t soldier_frames_pain2 [] = { }; const mmove_t soldier_move_pain2 = {FRAME_pain201, FRAME_pain207, soldier_frames_pain2, soldier_run}; -static const mframe_t soldier_frames_pain3 [] = { +static const mframe_t soldier_frames_pain3[] = { { ai_move, -8, NULL }, { ai_move, 10, NULL }, { ai_move, -4, NULL }, @@ -304,7 +298,7 @@ static const mframe_t soldier_frames_pain3 [] = { }; const mmove_t soldier_move_pain3 = {FRAME_pain301, FRAME_pain318, soldier_frames_pain3, soldier_run}; -static const mframe_t soldier_frames_pain4 [] = { +static const mframe_t soldier_frames_pain4[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -325,7 +319,6 @@ static const mframe_t soldier_frames_pain4 [] = { }; const mmove_t soldier_move_pain4 = {FRAME_pain401, FRAME_pain417, soldier_frames_pain4, soldier_run}; - void soldier_pain(edict_t *self, edict_t *other, float kick, int damage) { float r; @@ -368,12 +361,11 @@ void soldier_pain(edict_t *self, edict_t *other, float kick, int damage) self->monsterinfo.currentmove = &soldier_move_pain3; } - // // ATTACK // -static const byte blaster_flash [] = { +static const byte blaster_flash[] = { MZ2_SOLDIER_BLASTER_1, MZ2_SOLDIER_BLASTER_2, MZ2_SOLDIER_BLASTER_3, @@ -384,7 +376,7 @@ static const byte blaster_flash [] = { MZ2_SOLDIER_BLASTER_8 }; -static const byte shotgun_flash [] = { +static const byte shotgun_flash[] = { MZ2_SOLDIER_SHOTGUN_1, MZ2_SOLDIER_SHOTGUN_2, MZ2_SOLDIER_SHOTGUN_3, @@ -395,7 +387,7 @@ static const byte shotgun_flash [] = { MZ2_SOLDIER_SHOTGUN_8 }; -static const byte machinegun_flash [] = { +static const byte machinegun_flash[] = { MZ2_SOLDIER_MACHINEGUN_1, MZ2_SOLDIER_MACHINEGUN_2, MZ2_SOLDIER_MACHINEGUN_3, @@ -495,7 +487,7 @@ void soldier_attack1_refire2(edict_t *self) self->monsterinfo.nextframe = FRAME_attak102; } -static const mframe_t soldier_frames_attack1 [] = { +static const mframe_t soldier_frames_attack1[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, soldier_fire1 }, @@ -544,7 +536,7 @@ void soldier_attack2_refire2(edict_t *self) self->monsterinfo.nextframe = FRAME_attak204; } -static const mframe_t soldier_frames_attack2 [] = { +static const mframe_t soldier_frames_attack2[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -599,7 +591,7 @@ void soldier_attack3_refire(edict_t *self) self->monsterinfo.nextframe = FRAME_attak303; } -static const mframe_t soldier_frames_attack3 [] = { +static const mframe_t soldier_frames_attack3[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, soldier_fire3 }, @@ -619,7 +611,7 @@ void soldier_fire4(edict_t *self) soldier_fire(self, 3); } -static const mframe_t soldier_frames_attack4 [] = { +static const mframe_t soldier_frames_attack4[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, soldier_fire4 }, @@ -648,7 +640,7 @@ void soldier_attack6_refire(edict_t *self) self->monsterinfo.nextframe = FRAME_runs03; } -static const mframe_t soldier_frames_attack6 [] = { +static const mframe_t soldier_frames_attack6[] = { { ai_charge, 10, NULL }, { ai_charge, 4, NULL }, { ai_charge, 12, NULL }, @@ -678,7 +670,6 @@ void soldier_attack(edict_t *self) } } - // // SIGHT // @@ -708,7 +699,7 @@ void soldier_duck_hold(edict_t *self) self->monsterinfo.aiflags |= AI_HOLD_FRAME; } -static const mframe_t soldier_frames_duck [] = { +static const mframe_t soldier_frames_duck[] = { { ai_move, 5, soldier_duck_down }, { ai_move, -1, soldier_duck_hold }, { ai_move, 1, NULL }, @@ -755,7 +746,6 @@ void soldier_dodge(edict_t *self, edict_t *attacker, float eta) self->monsterinfo.currentmove = &soldier_move_attack3; } - // // DEATH // @@ -780,7 +770,7 @@ void soldier_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t soldier_frames_death1 [] = { +static const mframe_t soldier_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, -10, NULL }, { ai_move, -10, NULL }, @@ -823,7 +813,7 @@ static const mframe_t soldier_frames_death1 [] = { }; const mmove_t soldier_move_death1 = {FRAME_death101, FRAME_death136, soldier_frames_death1, soldier_dead}; -static const mframe_t soldier_frames_death2 [] = { +static const mframe_t soldier_frames_death2[] = { { ai_move, -5, NULL }, { ai_move, -5, NULL }, { ai_move, -5, NULL }, @@ -865,7 +855,7 @@ static const mframe_t soldier_frames_death2 [] = { }; const mmove_t soldier_move_death2 = {FRAME_death201, FRAME_death235, soldier_frames_death2, soldier_dead}; -static const mframe_t soldier_frames_death3 [] = { +static const mframe_t soldier_frames_death3[] = { { ai_move, -5, NULL }, { ai_move, -5, NULL }, { ai_move, -5, NULL }, @@ -918,7 +908,7 @@ static const mframe_t soldier_frames_death3 [] = { }; const mmove_t soldier_move_death3 = {FRAME_death301, FRAME_death345, soldier_frames_death3, soldier_dead}; -static const mframe_t soldier_frames_death4 [] = { +static const mframe_t soldier_frames_death4[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -980,7 +970,7 @@ static const mframe_t soldier_frames_death4 [] = { }; const mmove_t soldier_move_death4 = {FRAME_death401, FRAME_death453, soldier_frames_death4, soldier_dead}; -static const mframe_t soldier_frames_death5 [] = { +static const mframe_t soldier_frames_death5[] = { { ai_move, -5, NULL }, { ai_move, -5, NULL }, { ai_move, -5, NULL }, @@ -1010,7 +1000,7 @@ static const mframe_t soldier_frames_death5 [] = { }; const mmove_t soldier_move_death5 = {FRAME_death501, FRAME_death524, soldier_frames_death5, soldier_dead}; -static const mframe_t soldier_frames_death6 [] = { +static const mframe_t soldier_frames_death6[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -1073,7 +1063,6 @@ void soldier_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damag self->monsterinfo.currentmove = &soldier_move_death6; } - // // SPAWN // @@ -1113,7 +1102,6 @@ void SP_monster_soldier_x(edict_t *self) walkmonster_start(self); } - /*QUAKED monster_soldier_light (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight */ void SP_monster_soldier_light(edict_t *self) diff --git a/src/baseq2/m_supertank.c b/src/baseq2/m_supertank.c index 35ca74606..7f7077f58 100644 --- a/src/baseq2/m_supertank.c +++ b/src/baseq2/m_supertank.c @@ -52,18 +52,16 @@ void supertank_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search2, 1, ATTN_NORM, 0); } - void supertank_dead(edict_t *self); void supertankRocket(edict_t *self); void supertankMachineGun(edict_t *self); void supertank_reattack1(edict_t *self); - // // stand // -static const mframe_t supertank_frames_stand [] = { +static const mframe_t supertank_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -132,8 +130,7 @@ void supertank_stand(edict_t *self) self->monsterinfo.currentmove = &supertank_move_stand; } - -static const mframe_t supertank_frames_run [] = { +static const mframe_t supertank_frames_run[] = { { ai_run, 12, TreadSound }, { ai_run, 12, NULL }, { ai_run, 12, NULL }, @@ -159,8 +156,7 @@ const mmove_t supertank_move_run = {FRAME_forwrd_1, FRAME_forwrd_18, supertank_f // walk // - -static const mframe_t supertank_frames_forward [] = { +static const mframe_t supertank_frames_forward[] = { { ai_walk, 4, TreadSound }, { ai_walk, 4, NULL }, { ai_walk, 4, NULL }, @@ -200,7 +196,7 @@ void supertank_run(edict_t *self) self->monsterinfo.currentmove = &supertank_move_run; } -static const mframe_t supertank_frames_turn_right [] = { +static const mframe_t supertank_frames_turn_right[] = { { ai_move, 0, TreadSound }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -222,7 +218,7 @@ static const mframe_t supertank_frames_turn_right [] = { }; const mmove_t supertank_move_turn_right = {FRAME_right_1, FRAME_right_18, supertank_frames_turn_right, supertank_run}; -static const mframe_t supertank_frames_turn_left [] = { +static const mframe_t supertank_frames_turn_left[] = { { ai_move, 0, TreadSound }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -244,8 +240,7 @@ static const mframe_t supertank_frames_turn_left [] = { }; const mmove_t supertank_move_turn_left = {FRAME_left_1, FRAME_left_18, supertank_frames_turn_left, supertank_run}; - -static const mframe_t supertank_frames_pain3 [] = { +static const mframe_t supertank_frames_pain3[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -253,7 +248,7 @@ static const mframe_t supertank_frames_pain3 [] = { }; const mmove_t supertank_move_pain3 = {FRAME_pain3_9, FRAME_pain3_12, supertank_frames_pain3, supertank_run}; -static const mframe_t supertank_frames_pain2 [] = { +static const mframe_t supertank_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -261,7 +256,7 @@ static const mframe_t supertank_frames_pain2 [] = { }; const mmove_t supertank_move_pain2 = {FRAME_pain2_5, FRAME_pain2_8, supertank_frames_pain2, supertank_run}; -static const mframe_t supertank_frames_pain1 [] = { +static const mframe_t supertank_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -269,7 +264,7 @@ static const mframe_t supertank_frames_pain1 [] = { }; const mmove_t supertank_move_pain1 = {FRAME_pain1_1, FRAME_pain1_4, supertank_frames_pain1, supertank_run}; -static const mframe_t supertank_frames_death1 [] = { +static const mframe_t supertank_frames_death1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -420,7 +415,6 @@ static const mframe_t supertank_frames_end_attack1[] = { }; const mmove_t supertank_move_end_attack1 = {FRAME_attak1_7, FRAME_attak1_20, supertank_frames_end_attack1, supertank_run}; - void supertank_reattack1(edict_t *self) { if (visible(self, self->enemy)) @@ -468,7 +462,6 @@ void supertank_pain(edict_t *self, edict_t *other, float kick, int damage) } } - void supertankRocket(edict_t *self) { vec3_t forward, right; @@ -524,7 +517,6 @@ void supertankMachineGun(edict_t *self) monster_fire_bullet(self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number); } - void supertank_attack(edict_t *self) { vec3_t vec; @@ -544,7 +536,6 @@ void supertank_attack(edict_t *self) } } - // // death // @@ -559,7 +550,6 @@ void supertank_dead(edict_t *self) gi.linkentity(self); } - void BossExplode(edict_t *self) { vec3_t org; @@ -621,7 +611,6 @@ void BossExplode(edict_t *self) self->nextthink = level.framenum + 1; } - void supertank_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0); diff --git a/src/baseq2/m_tank.c b/src/baseq2/m_tank.c index 98d69adc1..24bdaf47b 100644 --- a/src/baseq2/m_tank.c +++ b/src/baseq2/m_tank.c @@ -26,7 +26,6 @@ TANK #include "g_local.h" #include "m_tank.h" - void tank_refire_rocket(edict_t *self); void tank_doattack_rocket(edict_t *self); void tank_reattack_blaster(edict_t *self); @@ -49,7 +48,6 @@ void tank_sight(edict_t *self, edict_t *other) gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } - void tank_footstep(edict_t *self) { gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0); @@ -70,12 +68,11 @@ void tank_idle(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0); } - // // stand // -static const mframe_t tank_frames_stand [] = { +static const mframe_t tank_frames_stand[] = { { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, { ai_stand, 0, NULL }, @@ -114,14 +111,13 @@ void tank_stand(edict_t *self) self->monsterinfo.currentmove = &tank_move_stand; } - // // walk // void tank_walk(edict_t *self); -static const mframe_t tank_frames_start_walk [] = { +static const mframe_t tank_frames_start_walk[] = { { ai_walk, 0, NULL }, { ai_walk, 6, NULL }, { ai_walk, 6, NULL }, @@ -129,7 +125,7 @@ static const mframe_t tank_frames_start_walk [] = { }; const mmove_t tank_move_start_walk = {FRAME_walk01, FRAME_walk04, tank_frames_start_walk, tank_walk}; -static const mframe_t tank_frames_walk [] = { +static const mframe_t tank_frames_walk[] = { { ai_walk, 4, NULL }, { ai_walk, 5, NULL }, { ai_walk, 3, NULL }, @@ -149,7 +145,7 @@ static const mframe_t tank_frames_walk [] = { }; const mmove_t tank_move_walk = {FRAME_walk05, FRAME_walk20, tank_frames_walk, NULL}; -static const mframe_t tank_frames_stop_walk [] = { +static const mframe_t tank_frames_stop_walk[] = { { ai_walk, 3, NULL }, { ai_walk, 3, NULL }, { ai_walk, 2, NULL }, @@ -163,14 +159,13 @@ void tank_walk(edict_t *self) self->monsterinfo.currentmove = &tank_move_walk; } - // // run // void tank_run(edict_t *self); -static const mframe_t tank_frames_start_run [] = { +static const mframe_t tank_frames_start_run[] = { { ai_run, 0, NULL }, { ai_run, 6, NULL }, { ai_run, 6, NULL }, @@ -178,7 +173,7 @@ static const mframe_t tank_frames_start_run [] = { }; const mmove_t tank_move_start_run = {FRAME_walk01, FRAME_walk04, tank_frames_start_run, tank_run}; -static const mframe_t tank_frames_run [] = { +static const mframe_t tank_frames_run[] = { { ai_run, 4, NULL }, { ai_run, 5, NULL }, { ai_run, 3, NULL }, @@ -198,7 +193,7 @@ static const mframe_t tank_frames_run [] = { }; const mmove_t tank_move_run = {FRAME_walk05, FRAME_walk20, tank_frames_run, NULL}; -static const mframe_t tank_frames_stop_run [] = { +static const mframe_t tank_frames_stop_run[] = { { ai_run, 3, NULL }, { ai_run, 3, NULL }, { ai_run, 2, NULL }, @@ -231,7 +226,7 @@ void tank_run(edict_t *self) // pain // -static const mframe_t tank_frames_pain1 [] = { +static const mframe_t tank_frames_pain1[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -239,7 +234,7 @@ static const mframe_t tank_frames_pain1 [] = { }; const mmove_t tank_move_pain1 = {FRAME_pain101, FRAME_pain104, tank_frames_pain1, tank_run}; -static const mframe_t tank_frames_pain2 [] = { +static const mframe_t tank_frames_pain2[] = { { ai_move, 0, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -248,7 +243,7 @@ static const mframe_t tank_frames_pain2 [] = { }; const mmove_t tank_move_pain2 = {FRAME_pain201, FRAME_pain205, tank_frames_pain2, tank_run}; -static const mframe_t tank_frames_pain3 [] = { +static const mframe_t tank_frames_pain3[] = { { ai_move, -7, NULL }, { ai_move, 0, NULL }, { ai_move, 0, NULL }, @@ -268,7 +263,6 @@ static const mframe_t tank_frames_pain3 [] = { }; const mmove_t tank_move_pain3 = {FRAME_pain301, FRAME_pain316, tank_frames_pain3, tank_run}; - void tank_pain(edict_t *self, edict_t *other, float kick, int damage) { if (self->health < (self->max_health / 2)) @@ -306,7 +300,6 @@ void tank_pain(edict_t *self, edict_t *other, float kick, int damage) self->monsterinfo.currentmove = &tank_move_pain3; } - // // attacks // @@ -400,8 +393,7 @@ void TankMachineGun(edict_t *self) monster_fire_bullet(self, start, forward, 20, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number); } - -static const mframe_t tank_frames_attack_blast [] = { +static const mframe_t tank_frames_attack_blast[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -421,7 +413,7 @@ static const mframe_t tank_frames_attack_blast [] = { }; const mmove_t tank_move_attack_blast = {FRAME_attak101, FRAME_attak116, tank_frames_attack_blast, tank_reattack_blaster}; -static const mframe_t tank_frames_reattack_blast [] = { +static const mframe_t tank_frames_reattack_blast[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, TankBlaster }, @@ -431,7 +423,7 @@ static const mframe_t tank_frames_reattack_blast [] = { }; const mmove_t tank_move_reattack_blast = {FRAME_attak111, FRAME_attak116, tank_frames_reattack_blast, tank_reattack_blaster}; -static const mframe_t tank_frames_attack_post_blast [] = { +static const mframe_t tank_frames_attack_post_blast[] = { { ai_move, 0, NULL }, // 17 { ai_move, 0, NULL }, { ai_move, 2, NULL }, @@ -453,14 +445,13 @@ void tank_reattack_blaster(edict_t *self) self->monsterinfo.currentmove = &tank_move_attack_post_blast; } - void tank_poststrike(edict_t *self) { self->enemy = NULL; tank_run(self); } -static const mframe_t tank_frames_attack_strike [] = { +static const mframe_t tank_frames_attack_strike[] = { { ai_move, 3, NULL }, { ai_move, 2, NULL }, { ai_move, 2, NULL }, @@ -502,7 +493,7 @@ static const mframe_t tank_frames_attack_strike [] = { }; const mmove_t tank_move_attack_strike = {FRAME_attak201, FRAME_attak238, tank_frames_attack_strike, tank_poststrike}; -static const mframe_t tank_frames_attack_pre_rocket [] = { +static const mframe_t tank_frames_attack_pre_rocket[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -529,7 +520,7 @@ static const mframe_t tank_frames_attack_pre_rocket [] = { }; const mmove_t tank_move_attack_pre_rocket = {FRAME_attak301, FRAME_attak321, tank_frames_attack_pre_rocket, tank_doattack_rocket}; -static const mframe_t tank_frames_attack_fire_rocket [] = { +static const mframe_t tank_frames_attack_fire_rocket[] = { { ai_charge, -3, NULL }, // Loop Start 22 { ai_charge, 0, NULL }, { ai_charge, 0, TankRocket }, // 24 @@ -542,7 +533,7 @@ static const mframe_t tank_frames_attack_fire_rocket [] = { }; const mmove_t tank_move_attack_fire_rocket = {FRAME_attak322, FRAME_attak330, tank_frames_attack_fire_rocket, tank_refire_rocket}; -static const mframe_t tank_frames_attack_post_rocket [] = { +static const mframe_t tank_frames_attack_post_rocket[] = { { ai_charge, 0, NULL }, // 31 { ai_charge, -1, NULL }, { ai_charge, -1, NULL }, @@ -571,7 +562,7 @@ static const mframe_t tank_frames_attack_post_rocket [] = { }; const mmove_t tank_move_attack_post_rocket = {FRAME_attak331, FRAME_attak353, tank_frames_attack_post_rocket, tank_run}; -static const mframe_t tank_frames_attack_chain [] = { +static const mframe_t tank_frames_attack_chain[] = { { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, { ai_charge, 0, NULL }, @@ -660,7 +651,6 @@ void tank_attack(edict_t *self) } } - // // death // @@ -675,7 +665,7 @@ void tank_dead(edict_t *self) gi.linkentity(self); } -static const mframe_t tank_frames_death1 [] = { +static const mframe_t tank_frames_death1[] = { { ai_move, -7, NULL }, { ai_move, -2, NULL }, { ai_move, -2, NULL }, @@ -740,7 +730,6 @@ void tank_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, } - // // monster_tank // diff --git a/src/baseq2/p_client.c b/src/baseq2/p_client.c index bd9421d9a..5230bf398 100644 --- a/src/baseq2/p_client.c +++ b/src/baseq2/p_client.c @@ -96,7 +96,6 @@ void SP_CreateCoopSpots(edict_t *self) } } - /*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 32) The normal starting point for a level. */ @@ -154,7 +153,6 @@ void SP_info_player_coop(edict_t *self) } } - /*QUAKED info_player_intermission (1 0 1) (-16 -16 -24) (16 16 32) The deathmatch intermission point will be at one of these Use 'angles' instead of 'angle', so you can set pitch or roll as well as yaw. 'pitch yaw roll' @@ -163,16 +161,13 @@ void SP_info_player_intermission(edict_t *ent) { } - //======================================================================= - void player_pain(edict_t *self, edict_t *other, float kick, int damage) { // player pain is handled at the end of the frame in P_DamageFeedback } - bool IsFemale(edict_t *ent) { char *info; @@ -386,7 +381,6 @@ void ClientObituary(edict_t *self, edict_t *inflictor, edict_t *attacker) self->client->resp.score--; } - void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf); void TossClientWeapon(edict_t *self) @@ -434,7 +428,6 @@ void TossClientWeapon(edict_t *self) } } - /* ================== LookAtKiller @@ -465,7 +458,6 @@ void LookAtKiller(edict_t *self, edict_t *inflictor, edict_t *attacker) if (self->client->killer_yaw < 0) self->client->killer_yaw += 360; - } /* @@ -614,7 +606,6 @@ void InitClientPersistant(gclient_t *client) client->pers.connected = true; } - void InitClientResp(gclient_t *client) { memset(&client->resp, 0, sizeof(client->resp)); @@ -637,7 +628,7 @@ void SaveClientData(void) int i; edict_t *ent; - for (i = 0 ; i < game.maxclients ; i++) { + for (i = 0; i < game.maxclients; i++) { ent = &g_edicts[1 + i]; if (!ent->inuse) continue; @@ -658,8 +649,6 @@ void FetchClientEntData(edict_t *ent) ent->client->resp.score = ent->client->pers.score; } - - /* ======================================================================= @@ -683,7 +672,6 @@ float PlayersRangeFromSpot(edict_t *spot) int n; float playerdistance; - bestplayerdistance = 9999999; for (n = 1; n <= maxclients->value; n++) { @@ -768,7 +756,6 @@ edict_t *SelectFarthestDeathmatchSpawnPoint(void) float bestdistance, bestplayerdistance; edict_t *spot; - spot = NULL; bestspot = NULL; bestdistance = 0; @@ -800,7 +787,6 @@ edict_t *SelectDeathmatchSpawnPoint(void) return SelectRandomDeathmatchSpawnPoint(); } - edict_t *SelectCoopSpawnPoint(edict_t *ent) { int index; @@ -832,11 +818,9 @@ edict_t *SelectCoopSpawnPoint(edict_t *ent) } } - return spot; } - /* =========== SelectSpawnPoint @@ -882,14 +866,13 @@ void SelectSpawnPoint(edict_t *ent, vec3_t origin, vec3_t angles) //====================================================================== - void InitBodyQue(void) { int i; edict_t *ent; level.body_que = 0; - for (i = 0; i < BODY_QUEUE_SIZE ; i++) { + for (i = 0; i < BODY_QUEUE_SIZE; i++) { ent = G_Spawn(); ent->classname = "bodyque"; } @@ -1066,7 +1049,6 @@ void spectator_respawn(edict_t *ent) //============================================================== - /* =========== PutClientInServer @@ -1208,7 +1190,7 @@ void PutClientInServer(edict_t *ent) spawn_angles[ROLL] = 0; // set the delta angle - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { client->ps.pmove.delta_angles[i] = ANGLE2SHORT(spawn_angles[i] - client->resp.cmd_angles[i]); } @@ -1275,7 +1257,6 @@ void ClientBeginDeathmatch(edict_t *ent) ClientEndServerFrame(ent); } - /* =========== ClientBegin @@ -1302,7 +1283,7 @@ void ClientBegin(edict_t *ent) // connecting to the server, which is different than the // state when the game is saved, so we need to compensate // with deltaangles - for (i = 0 ; i < 3 ; i++) + for (i = 0; i < 3; i++) ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(ent->client->ps.viewangles[i]); } else { // a spawn point will completely reinitialize the entity @@ -1393,7 +1374,6 @@ void ClientUserinfoChanged(edict_t *ent, char *userinfo) Q_strlcpy(ent->client->pers.userinfo, userinfo, sizeof(ent->client->pers.userinfo)); } - /* =========== ClientConnect @@ -1448,7 +1428,6 @@ qboolean ClientConnect(edict_t *ent, char *userinfo) } } - // they can connect ent->client = game.clients + (ent - g_edicts - 1); @@ -1514,10 +1493,8 @@ void ClientDisconnect(edict_t *ent) //gi.configstring (CS_PLAYERSKINS+playernum, ""); } - //============================================================== - edict_t *pm_passent; // pmove doesn't need to know about passent and contentmask @@ -1581,7 +1558,7 @@ void ClientThink(edict_t *ent, usercmd_t *ucmd) client->ps.pmove.gravity = sv_gravity->value; pm.s = client->ps.pmove; - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { pm.s.origin[i] = COORD2SHORT(ent->s.origin[i]); pm.s.velocity[i] = COORD2SHORT(ent->velocity[i]); } @@ -1599,7 +1576,7 @@ void ClientThink(edict_t *ent, usercmd_t *ucmd) // perform a pmove gi.Pmove(&pm); - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { ent->s.origin[i] = SHORT2COORD(pm.s.origin[i]); ent->velocity[i] = SHORT2COORD(pm.s.velocity[i]); } @@ -1642,9 +1619,9 @@ void ClientThink(edict_t *ent, usercmd_t *ucmd) G_TouchTriggers(ent); // touch other objects - for (i = 0 ; i < pm.numtouch ; i++) { + for (i = 0; i < pm.numtouch; i++) { other = pm.touchents[i]; - for (j = 0 ; j < i ; j++) + for (j = 0; j < i; j++) if (pm.touchents[j] == other) break; if (j != i) @@ -1703,7 +1680,6 @@ void ClientThink(edict_t *ent, usercmd_t *ucmd) } } - /* ============== ClientBeginServerFrame diff --git a/src/baseq2/p_hud.c b/src/baseq2/p_hud.c index d03b228dd..b016ba1a3 100644 --- a/src/baseq2/p_hud.c +++ b/src/baseq2/p_hud.c @@ -87,7 +87,7 @@ void BeginIntermission(edict_t *targ) game.autosaved = false; // respawn any dead clients - for (i = 0 ; i < maxclients->value ; i++) { + for (i = 0; i < maxclients->value; i++) { client = g_edicts + 1 + i; if (!client->inuse) continue; @@ -100,7 +100,7 @@ void BeginIntermission(edict_t *targ) if (strchr(level.changemap, '*')) { if (coop->value) { - for (i = 0 ; i < maxclients->value ; i++) { + for (i = 0; i < maxclients->value; i++) { client = g_edicts + 1 + i; if (!client->inuse) continue; @@ -144,7 +144,7 @@ void BeginIntermission(edict_t *targ) } // move all clients to the intermission point - for (i = 0 ; i < maxclients->value ; i++) { + for (i = 0; i < maxclients->value; i++) { client = g_edicts + 1 + i; if (!client->inuse) continue; @@ -152,7 +152,6 @@ void BeginIntermission(edict_t *targ) } } - /* ================== DeathmatchScoreboardMessage @@ -175,16 +174,16 @@ void DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer) // sort the clients by score total = 0; - for (i = 0 ; i < game.maxclients ; i++) { + for (i = 0; i < game.maxclients; i++) { cl_ent = g_edicts + 1 + i; if (!cl_ent->inuse || game.clients[i].resp.spectator) continue; score = game.clients[i].resp.score; - for (j = 0 ; j < total ; j++) { + for (j = 0; j < total; j++) { if (score > sortedscores[j]) break; } - for (k = total ; k > j ; k--) { + for (k = total; k > j; k--) { sorted[k] = sorted[k - 1]; sortedscores[k] = sortedscores[k - 1]; } @@ -202,7 +201,7 @@ void DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer) if (total > 12) total = 12; - for (i = 0 ; i < total ; i++) { + for (i = 0; i < total; i++) { cl = &game.clients[sorted[i]]; cl_ent = g_edicts + 1 + sorted[i]; @@ -241,7 +240,6 @@ void DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer) gi.WriteString(string); } - /* ================== DeathmatchScoreboard @@ -256,7 +254,6 @@ void DeathmatchScoreboard(edict_t *ent) gi.unicast(ent, true); } - /* ================== Cmd_Score_f @@ -281,7 +278,6 @@ void Cmd_Score_f(edict_t *ent) DeathmatchScoreboard(ent); } - /* ================== HelpComputer @@ -325,7 +321,6 @@ void HelpComputer(edict_t *ent) gi.unicast(ent, true); } - /* ================== Cmd_Help_f @@ -354,7 +349,6 @@ void Cmd_Help_f(edict_t *ent) HelpComputer(ent); } - //======================================================================= /* diff --git a/src/baseq2/p_trail.c b/src/baseq2/p_trail.c index e2b0e8bbb..0070befbd 100644 --- a/src/baseq2/p_trail.c +++ b/src/baseq2/p_trail.c @@ -17,7 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "g_local.h" - /* ============================================================================== @@ -33,7 +32,6 @@ the player has been recently. It is used by monsters for pursuit. .aiment backward link */ - #define TRAIL_LENGTH 8 edict_t *trail[TRAIL_LENGTH]; @@ -43,7 +41,6 @@ bool trail_active = false; #define NEXT(n) (((n) + 1) & (TRAIL_LENGTH - 1)) #define PREV(n) (((n) - 1) & (TRAIL_LENGTH - 1)) - void PlayerTrail_Init(void) { int n; @@ -60,7 +57,6 @@ void PlayerTrail_Init(void) trail_active = true; } - void PlayerTrail_Add(vec3_t spot) { vec3_t temp; @@ -78,7 +74,6 @@ void PlayerTrail_Add(vec3_t spot) trail_head = NEXT(trail_head); } - void PlayerTrail_New(vec3_t spot) { if (!trail_active) @@ -88,7 +83,6 @@ void PlayerTrail_New(vec3_t spot) PlayerTrail_Add(spot); } - edict_t *PlayerTrail_PickFirst(edict_t *self) { int marker; diff --git a/src/baseq2/p_view.c b/src/baseq2/p_view.c index 0595c2141..9b256c13f 100644 --- a/src/baseq2/p_view.c +++ b/src/baseq2/p_view.c @@ -19,8 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "g_local.h" #include "m_player.h" - - static edict_t *current_player; static gclient_t *current_client; @@ -58,7 +56,6 @@ float SV_CalcRoll(vec3_t angles, vec3_t velocity) } - /* =============== P_DamageFeedback @@ -157,7 +154,6 @@ void P_DamageFeedback(edict_t *player) VectorMA(v, (float)client->damage_blood / realcount, bcolor, v); VectorCopy(v, client->damage_blend); - // // calculate view angle kicks // @@ -191,9 +187,6 @@ void P_DamageFeedback(edict_t *player) client->damage_knockback = 0; } - - - /* =============== SV_CalcViewOffset @@ -218,7 +211,6 @@ void SV_CalcViewOffset(edict_t *ent) float delta; vec3_t v; - //=================================== // base angles @@ -336,7 +328,7 @@ void SV_CalcGunOffset(edict_t *ent) ent->client->ps.gunangles[PITCH] = xyspeed * bobfracsin * 0.005f; // gun angles from delta movement - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { delta = ent->client->oldviewangles[i] - ent->client->ps.viewangles[i]; if (delta > 180) delta -= 360; @@ -353,14 +345,13 @@ void SV_CalcGunOffset(edict_t *ent) // ent->ps->gunorigin[2] += bob; // gun_x / gun_y / gun_z are development tools - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { ent->client->ps.gunoffset[i] += forward[i] * (gun_y->value); ent->client->ps.gunoffset[i] += right[i] * gun_x->value; ent->client->ps.gunoffset[i] += up[i] * (-gun_z->value); } } - /* ============= SV_AddBlend @@ -381,7 +372,6 @@ void SV_AddBlend(float r, float g, float b, float a, float *v_blend) v_blend[3] = a2; } - /* ============= SV_CalcBlend @@ -457,7 +447,6 @@ void SV_CalcBlend(edict_t *ent) ent->client->bonus_alpha = 0; } - /* ================= P_FallingDamage @@ -526,8 +515,6 @@ void P_FallingDamage(edict_t *ent) } } - - /* ============= P_WorldEffects @@ -677,7 +664,6 @@ void P_WorldEffects(void) } } - /* =============== G_SetClientEffects @@ -723,7 +709,6 @@ void G_SetClientEffects(edict_t *ent) } } - /* =============== G_SetClientEvent @@ -760,7 +745,6 @@ void G_SetClientSound(edict_t *ent) gi.sound(ent, CHAN_VOICE, gi.soundindex("misc/pc_up.wav"), 1, ATTN_STATIC, 0); } - if (ent->client->pers.weapon) weap = ent->client->pers.weapon->classname; else @@ -864,7 +848,6 @@ void G_SetClientFrame(edict_t *ent) } } - /* ================= ClientEndServerFrame @@ -889,7 +872,7 @@ void ClientEndServerFrame(edict_t *ent) // If it wasn't updated here, the view position would lag a frame // behind the body position when pushed -- "sinking into plats" // - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { current_client->ps.pmove.origin[i] = COORD2SHORT(ent->s.origin[i]); current_client->ps.pmove.velocity[i] = COORD2SHORT(ent->velocity[i]); } diff --git a/src/baseq2/p_weapon.c b/src/baseq2/p_weapon.c index 995a4e1cd..40230b651 100644 --- a/src/baseq2/p_weapon.c +++ b/src/baseq2/p_weapon.c @@ -20,15 +20,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "g_local.h" #include "m_player.h" - static bool is_quad; static byte is_silenced; - void weapon_grenade_fire(edict_t *ent, bool held); - -static void P_ProjectSource(edict_t* ent, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result) +static void P_ProjectSource(edict_t *ent, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result) { vec3_t _distance; @@ -56,7 +53,6 @@ static void P_ProjectSource(edict_t* ent, vec3_t point, vec3_t distance, vec3_t } } - /* =============== PlayerNoise @@ -86,7 +82,6 @@ void PlayerNoise(edict_t *who, vec3_t where, int type) if (who->flags & FL_NOTARGET) return; - if (!who->mynoise) { noise = G_Spawn(); noise->classname = "player_noise"; @@ -122,7 +117,6 @@ void PlayerNoise(edict_t *who, vec3_t where, int type) gi.linkentity(noise); } - bool Pickup_Weapon(edict_t *ent, edict_t *other) { int index; @@ -166,7 +160,6 @@ bool Pickup_Weapon(edict_t *ent, edict_t *other) return true; } - /* =============== ChangeWeapon @@ -292,7 +285,6 @@ void Think_Weapon(edict_t *ent) } } - /* ================ Use_Weapon @@ -328,8 +320,6 @@ void Use_Weapon(edict_t *ent, const gitem_t *item) ent->client->newweapon = item; } - - /* ================ Drop_Weapon @@ -353,7 +343,6 @@ void Drop_Weapon(edict_t *ent, const gitem_t *item) ent->client->pers.inventory[index]--; } - /* ================ Weapon_Generic @@ -485,7 +474,6 @@ static void Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE } } - /* ====================================================================== @@ -735,7 +723,6 @@ void Weapon_RocketLauncher(edict_t *ent) Weapon_Generic(ent, 4, 12, 50, 54, pause_frames, fire_frames, Weapon_RocketLauncher_Fire); } - /* ====================================================================== @@ -774,7 +761,6 @@ void Blaster_Fire(edict_t *ent, const vec3_t g_offset, int damage, bool hyper, i PlayerNoise(ent, start, PNOISE_WEAPON); } - void Weapon_Blaster_Fire(edict_t *ent) { int damage; @@ -795,7 +781,6 @@ void Weapon_Blaster(edict_t *ent) Weapon_Generic(ent, 4, 8, 52, 55, pause_frames, fire_frames, Weapon_Blaster_Fire); } - void Weapon_HyperBlaster_Fire(edict_t *ent) { float rotation; @@ -906,7 +891,7 @@ void Machinegun_Fire(edict_t *ent) kick *= 4; } - for (i = 1 ; i < 3 ; i++) { + for (i = 1; i < 3; i++) { ent->client->kick_origin[i] = crandom() * 0.35f; ent->client->kick_angles[i] = crandom() * 0.7f; } @@ -1028,12 +1013,12 @@ void Chaingun_Fire(edict_t *ent) kick *= 4; } - for (i = 0 ; i < 3 ; i++) { + for (i = 0; i < 3; i++) { ent->client->kick_origin[i] = crandom() * 0.35f; ent->client->kick_angles[i] = crandom() * 0.7f; } - for (i = 0 ; i < shots ; i++) { + for (i = 0; i < shots; i++) { // get start / end positions AngleVectors(ent->client->v_angle, forward, right, up); r = 7 + crandom() * 4; @@ -1056,7 +1041,6 @@ void Chaingun_Fire(edict_t *ent) ent->client->pers.inventory[ent->client->ammo_index] -= shots; } - void Weapon_Chaingun(edict_t *ent) { static const int pause_frames[] = {38, 43, 51, 61, 0}; @@ -1065,7 +1049,6 @@ void Weapon_Chaingun(edict_t *ent) Weapon_Generic(ent, 4, 31, 61, 64, pause_frames, fire_frames, Chaingun_Fire); } - /* ====================================================================== @@ -1126,7 +1109,6 @@ void Weapon_Shotgun(edict_t *ent) Weapon_Generic(ent, 7, 18, 36, 39, pause_frames, fire_frames, weapon_shotgun_fire); } - void weapon_supershotgun_fire(edict_t *ent) { vec3_t start; @@ -1203,8 +1185,6 @@ void Weapon_SuperShotgun(edict_t *ent) Weapon_Generic(ent, 6, 17, 57, 61, pause_frames, fire_frames, weapon_supershotgun_fire); } - - /* ====================================================================== @@ -1257,7 +1237,6 @@ void weapon_railgun_fire(edict_t *ent) ent->client->pers.inventory[ent->client->ammo_index]--; } - void Weapon_Railgun(edict_t *ent) { static const int pause_frames[] = {56, 0}; @@ -1266,7 +1245,6 @@ void Weapon_Railgun(edict_t *ent) Weapon_Generic(ent, 3, 18, 56, 61, pause_frames, fire_frames, weapon_railgun_fire); } - /* ====================================================================== @@ -1339,7 +1317,6 @@ void Weapon_BFG(edict_t *ent) Weapon_Generic(ent, 8, 32, 55, 58, pause_frames, fire_frames, weapon_bfg_fire); } - //====================================================================== /* From add72015225505e4aea009f086fc40a399a1733a Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Fri, 18 Aug 2023 13:54:16 +0300 Subject: [PATCH 13/15] Use BIT() macro for defining bit masks. --- inc/shared/shared.h | 2 + src/baseq2/g_local.h | 122 +++++++++++++++++++++---------------------- 2 files changed, 63 insertions(+), 61 deletions(-) diff --git a/inc/shared/shared.h b/inc/shared/shared.h index 8f5fbcecb..10c23c0f8 100644 --- a/inc/shared/shared.h +++ b/inc/shared/shared.h @@ -176,6 +176,8 @@ typedef struct vrect_s { #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) +#define BIT(n) (1U << (n)) + #define SWAP(type, a, b) \ do { type SWAP_tmp = a; a = b; b = SWAP_tmp; } while (0) diff --git a/src/baseq2/g_local.h b/src/baseq2/g_local.h index b251acbb3..22f49b6b3 100644 --- a/src/baseq2/g_local.h +++ b/src/baseq2/g_local.h @@ -48,27 +48,27 @@ with this program; if not, write to the Free Software Foundation, Inc., // edict->spawnflags // these are set with checkboxes on each entity in the map editor -#define SPAWNFLAG_NOT_EASY 0x00000100 -#define SPAWNFLAG_NOT_MEDIUM 0x00000200 -#define SPAWNFLAG_NOT_HARD 0x00000400 -#define SPAWNFLAG_NOT_DEATHMATCH 0x00000800 -#define SPAWNFLAG_NOT_COOP 0x00001000 +#define SPAWNFLAG_NOT_EASY BIT(8) +#define SPAWNFLAG_NOT_MEDIUM BIT(9) +#define SPAWNFLAG_NOT_HARD BIT(10) +#define SPAWNFLAG_NOT_DEATHMATCH BIT(11) +#define SPAWNFLAG_NOT_COOP BIT(12) // edict->flags -#define FL_FLY 0x00000001 -#define FL_SWIM 0x00000002 // implied immunity to drowining -#define FL_IMMUNE_LASER 0x00000004 -#define FL_INWATER 0x00000008 -#define FL_GODMODE 0x00000010 -#define FL_NOTARGET 0x00000020 -#define FL_IMMUNE_SLIME 0x00000040 -#define FL_IMMUNE_LAVA 0x00000080 -#define FL_PARTIALGROUND 0x00000100 // not all corners are valid -#define FL_WATERJUMP 0x00000200 // player jumping out of water -#define FL_TEAMSLAVE 0x00000400 // not the first on the team -#define FL_NO_KNOCKBACK 0x00000800 -#define FL_POWER_ARMOR 0x00001000 // power armor (if any) is active -#define FL_RESPAWN 0x80000000 // used for item respawning +#define FL_FLY BIT(0) +#define FL_SWIM BIT(1) // implied immunity to drowining +#define FL_IMMUNE_LASER BIT(2) +#define FL_INWATER BIT(3) +#define FL_GODMODE BIT(4) +#define FL_NOTARGET BIT(5) +#define FL_IMMUNE_SLIME BIT(6) +#define FL_IMMUNE_LAVA BIT(7) +#define FL_PARTIALGROUND BIT(8) // not all corners are valid +#define FL_WATERJUMP BIT(9) // player jumping out of water +#define FL_TEAMSLAVE BIT(10) // not the first on the team +#define FL_NO_KNOCKBACK BIT(11) +#define FL_POWER_ARMOR BIT(12) // power armor (if any) is active +#define FL_RESPAWN BIT(31) // used for item respawning #define FRAMETIME 0.1f @@ -119,21 +119,21 @@ typedef enum { #define GIB_METALLIC 1 //monster ai flags -#define AI_STAND_GROUND 0x00000001 -#define AI_TEMP_STAND_GROUND 0x00000002 -#define AI_SOUND_TARGET 0x00000004 -#define AI_LOST_SIGHT 0x00000008 -#define AI_PURSUIT_LAST_SEEN 0x00000010 -#define AI_PURSUE_NEXT 0x00000020 -#define AI_PURSUE_TEMP 0x00000040 -#define AI_HOLD_FRAME 0x00000080 -#define AI_GOOD_GUY 0x00000100 -#define AI_BRUTAL 0x00000200 -#define AI_NOSTEP 0x00000400 -#define AI_DUCKED 0x00000800 -#define AI_COMBAT_POINT 0x00001000 -#define AI_MEDIC 0x00002000 -#define AI_RESURRECTING 0x00004000 +#define AI_STAND_GROUND BIT(0) +#define AI_TEMP_STAND_GROUND BIT(1) +#define AI_SOUND_TARGET BIT(2) +#define AI_LOST_SIGHT BIT(3) +#define AI_PURSUIT_LAST_SEEN BIT(4) +#define AI_PURSUE_NEXT BIT(5) +#define AI_PURSUE_TEMP BIT(6) +#define AI_HOLD_FRAME BIT(7) +#define AI_GOOD_GUY BIT(8) +#define AI_BRUTAL BIT(9) +#define AI_NOSTEP BIT(10) +#define AI_DUCKED BIT(11) +#define AI_COMBAT_POINT BIT(12) +#define AI_MEDIC BIT(13) +#define AI_RESURRECTING BIT(14) //monster attack state #define AS_STRAIGHT 1 @@ -159,15 +159,15 @@ typedef enum { #define CENTER_HANDED 2 // game.serverflags values -#define SFL_CROSS_TRIGGER_1 0x00000001 -#define SFL_CROSS_TRIGGER_2 0x00000002 -#define SFL_CROSS_TRIGGER_3 0x00000004 -#define SFL_CROSS_TRIGGER_4 0x00000008 -#define SFL_CROSS_TRIGGER_5 0x00000010 -#define SFL_CROSS_TRIGGER_6 0x00000020 -#define SFL_CROSS_TRIGGER_7 0x00000040 -#define SFL_CROSS_TRIGGER_8 0x00000080 -#define SFL_CROSS_TRIGGER_MASK 0x000000ff +#define SFL_CROSS_TRIGGER_1 BIT(0) +#define SFL_CROSS_TRIGGER_2 BIT(1) +#define SFL_CROSS_TRIGGER_3 BIT(2) +#define SFL_CROSS_TRIGGER_4 BIT(3) +#define SFL_CROSS_TRIGGER_5 BIT(4) +#define SFL_CROSS_TRIGGER_6 BIT(5) +#define SFL_CROSS_TRIGGER_7 BIT(6) +#define SFL_CROSS_TRIGGER_8 BIT(7) +#define SFL_CROSS_TRIGGER_MASK (BIT(8) - 1) // noise types for PlayerNoise #define PNOISE_SELF 0 @@ -198,12 +198,12 @@ typedef struct { } gitem_armor_t; // gitem_t->flags -#define IT_WEAPON 1 // use makes active weapon -#define IT_AMMO 2 -#define IT_ARMOR 4 -#define IT_STAY_COOP 8 -#define IT_KEY 16 -#define IT_POWERUP 32 +#define IT_WEAPON BIT(0) // use makes active weapon +#define IT_AMMO BIT(1) +#define IT_ARMOR BIT(2) +#define IT_STAY_COOP BIT(3) +#define IT_KEY BIT(4) +#define IT_POWERUP BIT(5) // gitem_t->weapmodel for weapons indicates model index #define WEAP_BLASTER 1 @@ -471,7 +471,7 @@ extern int snd_fry; #define MOD_TRIGGER_HURT 31 #define MOD_HIT 32 #define MOD_TARGET_BLASTER 33 -#define MOD_FRIENDLY_FIRE 0x8000000 +#define MOD_FRIENDLY_FIRE BIT(31) extern int meansOfDeath; @@ -533,13 +533,13 @@ extern cvar_t *sv_flaregun; #define world (&g_edicts[0]) // item spawnflags -#define ITEM_TRIGGER_SPAWN 0x00000001 -#define ITEM_NO_TOUCH 0x00000002 +#define ITEM_TRIGGER_SPAWN BIT(0) +#define ITEM_NO_TOUCH BIT(1) // 6 bits reserved for editor flags // 8 bits used as power cube id bits for coop games -#define DROPPED_ITEM 0x00010000 -#define DROPPED_PLAYER_ITEM 0x00020000 -#define ITEM_TARGETS_USED 0x00040000 +#define DROPPED_ITEM BIT(16) +#define DROPPED_PLAYER_ITEM BIT(17) +#define ITEM_TARGETS_USED BIT(18) // // fields are needed for spawning from the entity string @@ -627,12 +627,12 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, const vec3_t void T_RadiusDamage(edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod); // damage flags -#define DAMAGE_RADIUS 0x00000001 // damage was indirect -#define DAMAGE_NO_ARMOR 0x00000002 // armour does not protect from this damage -#define DAMAGE_ENERGY 0x00000004 // damage is from an energy based weapon -#define DAMAGE_NO_KNOCKBACK 0x00000008 // do not affect velocity, just view angles -#define DAMAGE_BULLET 0x00000010 // damage is from a bullet (used for ricochets) -#define DAMAGE_NO_PROTECTION 0x00000020 // armor, shields, invulnerability, and godmode have no effect +#define DAMAGE_RADIUS BIT(0) // damage was indirect +#define DAMAGE_NO_ARMOR BIT(1) // armour does not protect from this damage +#define DAMAGE_ENERGY BIT(2) // damage is from an energy based weapon +#define DAMAGE_NO_KNOCKBACK BIT(3) // do not affect velocity, just view angles +#define DAMAGE_BULLET BIT(4) // damage is from a bullet (used for ricochets) +#define DAMAGE_NO_PROTECTION BIT(5) // armor, shields, invulnerability, and godmode have no effect #define DEFAULT_BULLET_HSPREAD 300 #define DEFAULT_BULLET_VSPREAD 500 From e89d62e2bbf51d3bdccb89be20c733e3491c307e Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Fri, 18 Aug 2023 14:03:52 +0300 Subject: [PATCH 14/15] Move monster flash definitions into separate file. --- inc/shared/m_flash.h | 252 +++++++++++++++++++++++++++++++++++++++++++ inc/shared/shared.h | 88 --------------- src/baseq2/g_local.h | 1 + src/client/effects.c | 1 + src/shared/m_flash.c | 1 + 5 files changed, 255 insertions(+), 88 deletions(-) create mode 100644 inc/shared/m_flash.h diff --git a/inc/shared/m_flash.h b/inc/shared/m_flash.h new file mode 100644 index 000000000..a95b3077b --- /dev/null +++ b/inc/shared/m_flash.h @@ -0,0 +1,252 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#pragma once + +enum { + MZ2_TANK_BLASTER_1 = 1, + MZ2_TANK_BLASTER_2, + MZ2_TANK_BLASTER_3, + MZ2_TANK_MACHINEGUN_1, + MZ2_TANK_MACHINEGUN_2, + MZ2_TANK_MACHINEGUN_3, + MZ2_TANK_MACHINEGUN_4, + MZ2_TANK_MACHINEGUN_5, + MZ2_TANK_MACHINEGUN_6, + MZ2_TANK_MACHINEGUN_7, + MZ2_TANK_MACHINEGUN_8, + MZ2_TANK_MACHINEGUN_9, + MZ2_TANK_MACHINEGUN_10, + MZ2_TANK_MACHINEGUN_11, + MZ2_TANK_MACHINEGUN_12, + MZ2_TANK_MACHINEGUN_13, + MZ2_TANK_MACHINEGUN_14, + MZ2_TANK_MACHINEGUN_15, + MZ2_TANK_MACHINEGUN_16, + MZ2_TANK_MACHINEGUN_17, + MZ2_TANK_MACHINEGUN_18, + MZ2_TANK_MACHINEGUN_19, + MZ2_TANK_ROCKET_1, + MZ2_TANK_ROCKET_2, + MZ2_TANK_ROCKET_3, + + MZ2_INFANTRY_MACHINEGUN_1, + MZ2_INFANTRY_MACHINEGUN_2, + MZ2_INFANTRY_MACHINEGUN_3, + MZ2_INFANTRY_MACHINEGUN_4, + MZ2_INFANTRY_MACHINEGUN_5, + MZ2_INFANTRY_MACHINEGUN_6, + MZ2_INFANTRY_MACHINEGUN_7, + MZ2_INFANTRY_MACHINEGUN_8, + MZ2_INFANTRY_MACHINEGUN_9, + MZ2_INFANTRY_MACHINEGUN_10, + MZ2_INFANTRY_MACHINEGUN_11, + MZ2_INFANTRY_MACHINEGUN_12, + MZ2_INFANTRY_MACHINEGUN_13, + + MZ2_SOLDIER_BLASTER_1, + MZ2_SOLDIER_BLASTER_2, + MZ2_SOLDIER_SHOTGUN_1, + MZ2_SOLDIER_SHOTGUN_2, + MZ2_SOLDIER_MACHINEGUN_1, + MZ2_SOLDIER_MACHINEGUN_2, + + MZ2_GUNNER_MACHINEGUN_1, + MZ2_GUNNER_MACHINEGUN_2, + MZ2_GUNNER_MACHINEGUN_3, + MZ2_GUNNER_MACHINEGUN_4, + MZ2_GUNNER_MACHINEGUN_5, + MZ2_GUNNER_MACHINEGUN_6, + MZ2_GUNNER_MACHINEGUN_7, + MZ2_GUNNER_MACHINEGUN_8, + MZ2_GUNNER_GRENADE_1, + MZ2_GUNNER_GRENADE_2, + MZ2_GUNNER_GRENADE_3, + MZ2_GUNNER_GRENADE_4, + + MZ2_CHICK_ROCKET_1, + + MZ2_FLYER_BLASTER_1, + MZ2_FLYER_BLASTER_2, + + MZ2_MEDIC_BLASTER_1, + + MZ2_GLADIATOR_RAILGUN_1, + + MZ2_HOVER_BLASTER_1, + + MZ2_ACTOR_MACHINEGUN_1, + + MZ2_SUPERTANK_MACHINEGUN_1, + MZ2_SUPERTANK_MACHINEGUN_2, + MZ2_SUPERTANK_MACHINEGUN_3, + MZ2_SUPERTANK_MACHINEGUN_4, + MZ2_SUPERTANK_MACHINEGUN_5, + MZ2_SUPERTANK_MACHINEGUN_6, + MZ2_SUPERTANK_ROCKET_1, + MZ2_SUPERTANK_ROCKET_2, + MZ2_SUPERTANK_ROCKET_3, + + MZ2_BOSS2_MACHINEGUN_L1, + MZ2_BOSS2_MACHINEGUN_L2, + MZ2_BOSS2_MACHINEGUN_L3, + MZ2_BOSS2_MACHINEGUN_L4, + MZ2_BOSS2_MACHINEGUN_L5, + MZ2_BOSS2_ROCKET_1, + MZ2_BOSS2_ROCKET_2, + MZ2_BOSS2_ROCKET_3, + MZ2_BOSS2_ROCKET_4, + + MZ2_FLOAT_BLASTER_1, + + MZ2_SOLDIER_BLASTER_3, + MZ2_SOLDIER_SHOTGUN_3, + MZ2_SOLDIER_MACHINEGUN_3, + MZ2_SOLDIER_BLASTER_4, + MZ2_SOLDIER_SHOTGUN_4, + MZ2_SOLDIER_MACHINEGUN_4, + MZ2_SOLDIER_BLASTER_5, + MZ2_SOLDIER_SHOTGUN_5, + MZ2_SOLDIER_MACHINEGUN_5, + MZ2_SOLDIER_BLASTER_6, + MZ2_SOLDIER_SHOTGUN_6, + MZ2_SOLDIER_MACHINEGUN_6, + MZ2_SOLDIER_BLASTER_7, + MZ2_SOLDIER_SHOTGUN_7, + MZ2_SOLDIER_MACHINEGUN_7, + MZ2_SOLDIER_BLASTER_8, + MZ2_SOLDIER_SHOTGUN_8, + MZ2_SOLDIER_MACHINEGUN_8, + +// --- Xian shit below --- + MZ2_MAKRON_BFG, + MZ2_MAKRON_BLASTER_1, + MZ2_MAKRON_BLASTER_2, + MZ2_MAKRON_BLASTER_3, + MZ2_MAKRON_BLASTER_4, + MZ2_MAKRON_BLASTER_5, + MZ2_MAKRON_BLASTER_6, + MZ2_MAKRON_BLASTER_7, + MZ2_MAKRON_BLASTER_8, + MZ2_MAKRON_BLASTER_9, + MZ2_MAKRON_BLASTER_10, + MZ2_MAKRON_BLASTER_11, + MZ2_MAKRON_BLASTER_12, + MZ2_MAKRON_BLASTER_13, + MZ2_MAKRON_BLASTER_14, + MZ2_MAKRON_BLASTER_15, + MZ2_MAKRON_BLASTER_16, + MZ2_MAKRON_BLASTER_17, + MZ2_MAKRON_RAILGUN_1, + MZ2_JORG_MACHINEGUN_L1, + MZ2_JORG_MACHINEGUN_L2, + MZ2_JORG_MACHINEGUN_L3, + MZ2_JORG_MACHINEGUN_L4, + MZ2_JORG_MACHINEGUN_L5, + MZ2_JORG_MACHINEGUN_L6, + MZ2_JORG_MACHINEGUN_R1, + MZ2_JORG_MACHINEGUN_R2, + MZ2_JORG_MACHINEGUN_R3, + MZ2_JORG_MACHINEGUN_R4, + MZ2_JORG_MACHINEGUN_R5, + MZ2_JORG_MACHINEGUN_R6, + MZ2_JORG_BFG_1, + MZ2_BOSS2_MACHINEGUN_R1, + MZ2_BOSS2_MACHINEGUN_R2, + MZ2_BOSS2_MACHINEGUN_R3, + MZ2_BOSS2_MACHINEGUN_R4, + MZ2_BOSS2_MACHINEGUN_R5, + +//ROGUE + MZ2_CARRIER_MACHINEGUN_L1, + MZ2_CARRIER_MACHINEGUN_R1, + MZ2_CARRIER_GRENADE, + MZ2_TURRET_MACHINEGUN, + MZ2_TURRET_ROCKET, + MZ2_TURRET_BLASTER, + MZ2_STALKER_BLASTER, + MZ2_DAEDALUS_BLASTER, + MZ2_MEDIC_BLASTER_2, + MZ2_CARRIER_RAILGUN, + MZ2_WIDOW_DISRUPTOR, + MZ2_WIDOW_BLASTER, + MZ2_WIDOW_RAIL, + MZ2_WIDOW_PLASMABEAM, // PMM - not used + MZ2_CARRIER_MACHINEGUN_L2, + MZ2_CARRIER_MACHINEGUN_R2, + MZ2_WIDOW_RAIL_LEFT, + MZ2_WIDOW_RAIL_RIGHT, + MZ2_WIDOW_BLASTER_SWEEP1, + MZ2_WIDOW_BLASTER_SWEEP2, + MZ2_WIDOW_BLASTER_SWEEP3, + MZ2_WIDOW_BLASTER_SWEEP4, + MZ2_WIDOW_BLASTER_SWEEP5, + MZ2_WIDOW_BLASTER_SWEEP6, + MZ2_WIDOW_BLASTER_SWEEP7, + MZ2_WIDOW_BLASTER_SWEEP8, + MZ2_WIDOW_BLASTER_SWEEP9, + MZ2_WIDOW_BLASTER_100, + MZ2_WIDOW_BLASTER_90, + MZ2_WIDOW_BLASTER_80, + MZ2_WIDOW_BLASTER_70, + MZ2_WIDOW_BLASTER_60, + MZ2_WIDOW_BLASTER_50, + MZ2_WIDOW_BLASTER_40, + MZ2_WIDOW_BLASTER_30, + MZ2_WIDOW_BLASTER_20, + MZ2_WIDOW_BLASTER_10, + MZ2_WIDOW_BLASTER_0, + MZ2_WIDOW_BLASTER_10L, + MZ2_WIDOW_BLASTER_20L, + MZ2_WIDOW_BLASTER_30L, + MZ2_WIDOW_BLASTER_40L, + MZ2_WIDOW_BLASTER_50L, + MZ2_WIDOW_BLASTER_60L, + MZ2_WIDOW_BLASTER_70L, + MZ2_WIDOW_RUN_1, + MZ2_WIDOW_RUN_2, + MZ2_WIDOW_RUN_3, + MZ2_WIDOW_RUN_4, + MZ2_WIDOW_RUN_5, + MZ2_WIDOW_RUN_6, + MZ2_WIDOW_RUN_7, + MZ2_WIDOW_RUN_8, + MZ2_CARRIER_ROCKET_1, + MZ2_CARRIER_ROCKET_2, + MZ2_CARRIER_ROCKET_3, + MZ2_CARRIER_ROCKET_4, + MZ2_WIDOW2_BEAMER_1, + MZ2_WIDOW2_BEAMER_2, + MZ2_WIDOW2_BEAMER_3, + MZ2_WIDOW2_BEAMER_4, + MZ2_WIDOW2_BEAMER_5, + MZ2_WIDOW2_BEAM_SWEEP_1, + MZ2_WIDOW2_BEAM_SWEEP_2, + MZ2_WIDOW2_BEAM_SWEEP_3, + MZ2_WIDOW2_BEAM_SWEEP_4, + MZ2_WIDOW2_BEAM_SWEEP_5, + MZ2_WIDOW2_BEAM_SWEEP_6, + MZ2_WIDOW2_BEAM_SWEEP_7, + MZ2_WIDOW2_BEAM_SWEEP_8, + MZ2_WIDOW2_BEAM_SWEEP_9, + MZ2_WIDOW2_BEAM_SWEEP_10, + MZ2_WIDOW2_BEAM_SWEEP_11, +//ROGUE +}; + +extern const vec3_t monster_flash_offset[256]; diff --git a/inc/shared/shared.h b/inc/shared/shared.h index 10c23c0f8..f48102f6c 100644 --- a/inc/shared/shared.h +++ b/inc/shared/shared.h @@ -964,94 +964,6 @@ enum { MZ_SILENCED = 128, // bit flag ORed with one of the above numbers }; -// -// monster muzzle flashes -// -enum { - MZ2_TANK_BLASTER_1 = 1, MZ2_TANK_BLASTER_2, MZ2_TANK_BLASTER_3, - MZ2_TANK_MACHINEGUN_1, MZ2_TANK_MACHINEGUN_2, MZ2_TANK_MACHINEGUN_3, - MZ2_TANK_MACHINEGUN_4, MZ2_TANK_MACHINEGUN_5, MZ2_TANK_MACHINEGUN_6, - MZ2_TANK_MACHINEGUN_7, MZ2_TANK_MACHINEGUN_8, MZ2_TANK_MACHINEGUN_9, - MZ2_TANK_MACHINEGUN_10, MZ2_TANK_MACHINEGUN_11, MZ2_TANK_MACHINEGUN_12, - MZ2_TANK_MACHINEGUN_13, MZ2_TANK_MACHINEGUN_14, MZ2_TANK_MACHINEGUN_15, - MZ2_TANK_MACHINEGUN_16, MZ2_TANK_MACHINEGUN_17, MZ2_TANK_MACHINEGUN_18, - MZ2_TANK_MACHINEGUN_19, MZ2_TANK_ROCKET_1, MZ2_TANK_ROCKET_2, - MZ2_TANK_ROCKET_3, MZ2_INFANTRY_MACHINEGUN_1, MZ2_INFANTRY_MACHINEGUN_2, - MZ2_INFANTRY_MACHINEGUN_3, MZ2_INFANTRY_MACHINEGUN_4, - MZ2_INFANTRY_MACHINEGUN_5, MZ2_INFANTRY_MACHINEGUN_6, - MZ2_INFANTRY_MACHINEGUN_7, MZ2_INFANTRY_MACHINEGUN_8, - MZ2_INFANTRY_MACHINEGUN_9, MZ2_INFANTRY_MACHINEGUN_10, - MZ2_INFANTRY_MACHINEGUN_11, MZ2_INFANTRY_MACHINEGUN_12, - MZ2_INFANTRY_MACHINEGUN_13, MZ2_SOLDIER_BLASTER_1, MZ2_SOLDIER_BLASTER_2, - MZ2_SOLDIER_SHOTGUN_1, MZ2_SOLDIER_SHOTGUN_2, MZ2_SOLDIER_MACHINEGUN_1, - MZ2_SOLDIER_MACHINEGUN_2, MZ2_GUNNER_MACHINEGUN_1, MZ2_GUNNER_MACHINEGUN_2, - MZ2_GUNNER_MACHINEGUN_3, MZ2_GUNNER_MACHINEGUN_4, MZ2_GUNNER_MACHINEGUN_5, - MZ2_GUNNER_MACHINEGUN_6, MZ2_GUNNER_MACHINEGUN_7, MZ2_GUNNER_MACHINEGUN_8, - MZ2_GUNNER_GRENADE_1, MZ2_GUNNER_GRENADE_2, MZ2_GUNNER_GRENADE_3, - MZ2_GUNNER_GRENADE_4, MZ2_CHICK_ROCKET_1, MZ2_FLYER_BLASTER_1, - MZ2_FLYER_BLASTER_2, MZ2_MEDIC_BLASTER_1, MZ2_GLADIATOR_RAILGUN_1, - MZ2_HOVER_BLASTER_1, MZ2_ACTOR_MACHINEGUN_1, MZ2_SUPERTANK_MACHINEGUN_1, - MZ2_SUPERTANK_MACHINEGUN_2, MZ2_SUPERTANK_MACHINEGUN_3, - MZ2_SUPERTANK_MACHINEGUN_4, MZ2_SUPERTANK_MACHINEGUN_5, - MZ2_SUPERTANK_MACHINEGUN_6, MZ2_SUPERTANK_ROCKET_1, MZ2_SUPERTANK_ROCKET_2, - MZ2_SUPERTANK_ROCKET_3, MZ2_BOSS2_MACHINEGUN_L1, MZ2_BOSS2_MACHINEGUN_L2, - MZ2_BOSS2_MACHINEGUN_L3, MZ2_BOSS2_MACHINEGUN_L4, MZ2_BOSS2_MACHINEGUN_L5, - MZ2_BOSS2_ROCKET_1, MZ2_BOSS2_ROCKET_2, MZ2_BOSS2_ROCKET_3, - MZ2_BOSS2_ROCKET_4, MZ2_FLOAT_BLASTER_1, MZ2_SOLDIER_BLASTER_3, - MZ2_SOLDIER_SHOTGUN_3, MZ2_SOLDIER_MACHINEGUN_3, MZ2_SOLDIER_BLASTER_4, - MZ2_SOLDIER_SHOTGUN_4, MZ2_SOLDIER_MACHINEGUN_4, MZ2_SOLDIER_BLASTER_5, - MZ2_SOLDIER_SHOTGUN_5, MZ2_SOLDIER_MACHINEGUN_5, MZ2_SOLDIER_BLASTER_6, - MZ2_SOLDIER_SHOTGUN_6, MZ2_SOLDIER_MACHINEGUN_6, MZ2_SOLDIER_BLASTER_7, - MZ2_SOLDIER_SHOTGUN_7, MZ2_SOLDIER_MACHINEGUN_7, MZ2_SOLDIER_BLASTER_8, - MZ2_SOLDIER_SHOTGUN_8, MZ2_SOLDIER_MACHINEGUN_8, - -// --- Xian shit below --- - MZ2_MAKRON_BFG, MZ2_MAKRON_BLASTER_1, MZ2_MAKRON_BLASTER_2, - MZ2_MAKRON_BLASTER_3, MZ2_MAKRON_BLASTER_4, MZ2_MAKRON_BLASTER_5, - MZ2_MAKRON_BLASTER_6, MZ2_MAKRON_BLASTER_7, MZ2_MAKRON_BLASTER_8, - MZ2_MAKRON_BLASTER_9, MZ2_MAKRON_BLASTER_10, MZ2_MAKRON_BLASTER_11, - MZ2_MAKRON_BLASTER_12, MZ2_MAKRON_BLASTER_13, MZ2_MAKRON_BLASTER_14, - MZ2_MAKRON_BLASTER_15, MZ2_MAKRON_BLASTER_16, MZ2_MAKRON_BLASTER_17, - MZ2_MAKRON_RAILGUN_1, MZ2_JORG_MACHINEGUN_L1, MZ2_JORG_MACHINEGUN_L2, - MZ2_JORG_MACHINEGUN_L3, MZ2_JORG_MACHINEGUN_L4, MZ2_JORG_MACHINEGUN_L5, - MZ2_JORG_MACHINEGUN_L6, MZ2_JORG_MACHINEGUN_R1, MZ2_JORG_MACHINEGUN_R2, - MZ2_JORG_MACHINEGUN_R3, MZ2_JORG_MACHINEGUN_R4, MZ2_JORG_MACHINEGUN_R5, - MZ2_JORG_MACHINEGUN_R6, MZ2_JORG_BFG_1, MZ2_BOSS2_MACHINEGUN_R1, - MZ2_BOSS2_MACHINEGUN_R2, MZ2_BOSS2_MACHINEGUN_R3, MZ2_BOSS2_MACHINEGUN_R4, - MZ2_BOSS2_MACHINEGUN_R5, - -//ROGUE - MZ2_CARRIER_MACHINEGUN_L1, MZ2_CARRIER_MACHINEGUN_R1, MZ2_CARRIER_GRENADE, - MZ2_TURRET_MACHINEGUN, MZ2_TURRET_ROCKET, MZ2_TURRET_BLASTER, - MZ2_STALKER_BLASTER, MZ2_DAEDALUS_BLASTER, MZ2_MEDIC_BLASTER_2, - MZ2_CARRIER_RAILGUN, MZ2_WIDOW_DISRUPTOR, MZ2_WIDOW_BLASTER, - MZ2_WIDOW_RAIL, MZ2_WIDOW_PLASMABEAM, MZ2_CARRIER_MACHINEGUN_L2, - MZ2_CARRIER_MACHINEGUN_R2, MZ2_WIDOW_RAIL_LEFT, MZ2_WIDOW_RAIL_RIGHT, - MZ2_WIDOW_BLASTER_SWEEP1, MZ2_WIDOW_BLASTER_SWEEP2, - MZ2_WIDOW_BLASTER_SWEEP3, MZ2_WIDOW_BLASTER_SWEEP4, - MZ2_WIDOW_BLASTER_SWEEP5, MZ2_WIDOW_BLASTER_SWEEP6, - MZ2_WIDOW_BLASTER_SWEEP7, MZ2_WIDOW_BLASTER_SWEEP8, - MZ2_WIDOW_BLASTER_SWEEP9, MZ2_WIDOW_BLASTER_100, MZ2_WIDOW_BLASTER_90, - MZ2_WIDOW_BLASTER_80, MZ2_WIDOW_BLASTER_70, MZ2_WIDOW_BLASTER_60, - MZ2_WIDOW_BLASTER_50, MZ2_WIDOW_BLASTER_40, MZ2_WIDOW_BLASTER_30, - MZ2_WIDOW_BLASTER_20, MZ2_WIDOW_BLASTER_10, MZ2_WIDOW_BLASTER_0, - MZ2_WIDOW_BLASTER_10L, MZ2_WIDOW_BLASTER_20L, MZ2_WIDOW_BLASTER_30L, - MZ2_WIDOW_BLASTER_40L, MZ2_WIDOW_BLASTER_50L, MZ2_WIDOW_BLASTER_60L, - MZ2_WIDOW_BLASTER_70L, MZ2_WIDOW_RUN_1, MZ2_WIDOW_RUN_2, MZ2_WIDOW_RUN_3, - MZ2_WIDOW_RUN_4, MZ2_WIDOW_RUN_5, MZ2_WIDOW_RUN_6, MZ2_WIDOW_RUN_7, - MZ2_WIDOW_RUN_8, MZ2_CARRIER_ROCKET_1, MZ2_CARRIER_ROCKET_2, - MZ2_CARRIER_ROCKET_3, MZ2_CARRIER_ROCKET_4, MZ2_WIDOW2_BEAMER_1, - MZ2_WIDOW2_BEAMER_2, MZ2_WIDOW2_BEAMER_3, MZ2_WIDOW2_BEAMER_4, - MZ2_WIDOW2_BEAMER_5, MZ2_WIDOW2_BEAM_SWEEP_1, MZ2_WIDOW2_BEAM_SWEEP_2, - MZ2_WIDOW2_BEAM_SWEEP_3, MZ2_WIDOW2_BEAM_SWEEP_4, MZ2_WIDOW2_BEAM_SWEEP_5, - MZ2_WIDOW2_BEAM_SWEEP_6, MZ2_WIDOW2_BEAM_SWEEP_7, MZ2_WIDOW2_BEAM_SWEEP_8, - MZ2_WIDOW2_BEAM_SWEEP_9, MZ2_WIDOW2_BEAM_SWEEP_10, - MZ2_WIDOW2_BEAM_SWEEP_11, -//ROGUE -}; - -extern const vec3_t monster_flash_offset[256]; - // temp entity events // diff --git a/src/baseq2/g_local.h b/src/baseq2/g_local.h index 22f49b6b3..72af20b47 100644 --- a/src/baseq2/g_local.h +++ b/src/baseq2/g_local.h @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "shared/shared.h" #include "shared/list.h" +#include "shared/m_flash.h" // define GAME_INCLUDE so that game.h does not define the // short, server-visible gclient_t and edict_t structures, diff --git a/src/client/effects.c b/src/client/effects.c index 4ea0e455f..efd790c4e 100644 --- a/src/client/effects.c +++ b/src/client/effects.c @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., // cl_fx.c -- entity effects parsing and management #include "client.h" +#include "shared/m_flash.h" static void CL_LogoutEffect(const vec3_t org, int type); diff --git a/src/shared/m_flash.c b/src/shared/m_flash.c index 3261c73e2..be2d5fa3f 100644 --- a/src/shared/m_flash.c +++ b/src/shared/m_flash.c @@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., // m_flash.c #include "shared/shared.h" +#include "shared/m_flash.h" // this file is included in both the game dll and quake2, // the game needs it to source shot locations, the client From 27a47c5b920973c9a9cc3c3198a3fc6b7d1a436b Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Fri, 18 Aug 2023 15:26:18 +0300 Subject: [PATCH 15/15] =?UTF-8?q?Rename=20=E2=80=98src/baseq2=E2=80=99=20s?= =?UTF-8?q?ubdir=20to=20=E2=80=98src/game=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CMakeLists.txt | 182 ++++++++++++------------ src/{baseq2 => game}/g_ai.c | 0 src/{baseq2 => game}/g_chase.c | 0 src/{baseq2 => game}/g_cmds.c | 0 src/{baseq2 => game}/g_combat.c | 0 src/{baseq2 => game}/g_func.c | 0 src/{baseq2 => game}/g_items.c | 0 src/{baseq2 => game}/g_local.h | 0 src/{baseq2 => game}/g_main.c | 0 src/{baseq2 => game}/g_misc.c | 0 src/{baseq2 => game}/g_monster.c | 0 src/{baseq2 => game}/g_phys.c | 0 src/{baseq2 => game}/g_ptrs.c | 0 src/{baseq2 => game}/g_ptrs.h | 0 src/{baseq2 => game}/g_ptrs_compat_v2.c | 0 src/{baseq2 => game}/g_save.c | 0 src/{baseq2 => game}/g_spawn.c | 0 src/{baseq2 => game}/g_svcmds.c | 0 src/{baseq2 => game}/g_target.c | 0 src/{baseq2 => game}/g_trigger.c | 0 src/{baseq2 => game}/g_turret.c | 0 src/{baseq2 => game}/g_utils.c | 0 src/{baseq2 => game}/g_weapon.c | 0 src/{baseq2 => game}/genptr.py | 0 src/{baseq2 => game}/m_actor.c | 0 src/{baseq2 => game}/m_actor.h | 0 src/{baseq2 => game}/m_berserk.c | 0 src/{baseq2 => game}/m_berserk.h | 0 src/{baseq2 => game}/m_boss2.c | 0 src/{baseq2 => game}/m_boss2.h | 0 src/{baseq2 => game}/m_boss3.c | 0 src/{baseq2 => game}/m_boss31.c | 0 src/{baseq2 => game}/m_boss31.h | 0 src/{baseq2 => game}/m_boss32.c | 0 src/{baseq2 => game}/m_boss32.h | 0 src/{baseq2 => game}/m_brain.c | 0 src/{baseq2 => game}/m_brain.h | 0 src/{baseq2 => game}/m_chick.c | 0 src/{baseq2 => game}/m_chick.h | 0 src/{baseq2 => game}/m_flipper.c | 0 src/{baseq2 => game}/m_flipper.h | 0 src/{baseq2 => game}/m_float.c | 0 src/{baseq2 => game}/m_float.h | 0 src/{baseq2 => game}/m_flyer.c | 0 src/{baseq2 => game}/m_flyer.h | 0 src/{baseq2 => game}/m_gladiator.c | 0 src/{baseq2 => game}/m_gladiator.h | 0 src/{baseq2 => game}/m_gunner.c | 0 src/{baseq2 => game}/m_gunner.h | 0 src/{baseq2 => game}/m_hover.c | 0 src/{baseq2 => game}/m_hover.h | 0 src/{baseq2 => game}/m_infantry.c | 0 src/{baseq2 => game}/m_infantry.h | 0 src/{baseq2 => game}/m_insane.c | 0 src/{baseq2 => game}/m_insane.h | 0 src/{baseq2 => game}/m_medic.c | 0 src/{baseq2 => game}/m_medic.h | 0 src/{baseq2 => game}/m_move.c | 0 src/{baseq2 => game}/m_mutant.c | 0 src/{baseq2 => game}/m_mutant.h | 0 src/{baseq2 => game}/m_parasite.c | 0 src/{baseq2 => game}/m_parasite.h | 0 src/{baseq2 => game}/m_player.h | 0 src/{baseq2 => game}/m_rider.h | 0 src/{baseq2 => game}/m_soldier.c | 0 src/{baseq2 => game}/m_soldier.h | 0 src/{baseq2 => game}/m_supertank.c | 0 src/{baseq2 => game}/m_supertank.h | 0 src/{baseq2 => game}/m_tank.c | 0 src/{baseq2 => game}/m_tank.h | 0 src/{baseq2 => game}/p_client.c | 0 src/{baseq2 => game}/p_hud.c | 0 src/{baseq2 => game}/p_trail.c | 0 src/{baseq2 => game}/p_view.c | 0 src/{baseq2 => game}/p_weapon.c | 0 src/windows/res/{baseq2.rc => game.rc} | 6 +- 76 files changed, 94 insertions(+), 94 deletions(-) rename src/{baseq2 => game}/g_ai.c (100%) rename src/{baseq2 => game}/g_chase.c (100%) rename src/{baseq2 => game}/g_cmds.c (100%) rename src/{baseq2 => game}/g_combat.c (100%) rename src/{baseq2 => game}/g_func.c (100%) rename src/{baseq2 => game}/g_items.c (100%) rename src/{baseq2 => game}/g_local.h (100%) rename src/{baseq2 => game}/g_main.c (100%) rename src/{baseq2 => game}/g_misc.c (100%) rename src/{baseq2 => game}/g_monster.c (100%) rename src/{baseq2 => game}/g_phys.c (100%) rename src/{baseq2 => game}/g_ptrs.c (100%) rename src/{baseq2 => game}/g_ptrs.h (100%) rename src/{baseq2 => game}/g_ptrs_compat_v2.c (100%) rename src/{baseq2 => game}/g_save.c (100%) rename src/{baseq2 => game}/g_spawn.c (100%) rename src/{baseq2 => game}/g_svcmds.c (100%) rename src/{baseq2 => game}/g_target.c (100%) rename src/{baseq2 => game}/g_trigger.c (100%) rename src/{baseq2 => game}/g_turret.c (100%) rename src/{baseq2 => game}/g_utils.c (100%) rename src/{baseq2 => game}/g_weapon.c (100%) rename src/{baseq2 => game}/genptr.py (100%) rename src/{baseq2 => game}/m_actor.c (100%) rename src/{baseq2 => game}/m_actor.h (100%) rename src/{baseq2 => game}/m_berserk.c (100%) rename src/{baseq2 => game}/m_berserk.h (100%) rename src/{baseq2 => game}/m_boss2.c (100%) rename src/{baseq2 => game}/m_boss2.h (100%) rename src/{baseq2 => game}/m_boss3.c (100%) rename src/{baseq2 => game}/m_boss31.c (100%) rename src/{baseq2 => game}/m_boss31.h (100%) rename src/{baseq2 => game}/m_boss32.c (100%) rename src/{baseq2 => game}/m_boss32.h (100%) rename src/{baseq2 => game}/m_brain.c (100%) rename src/{baseq2 => game}/m_brain.h (100%) rename src/{baseq2 => game}/m_chick.c (100%) rename src/{baseq2 => game}/m_chick.h (100%) rename src/{baseq2 => game}/m_flipper.c (100%) rename src/{baseq2 => game}/m_flipper.h (100%) rename src/{baseq2 => game}/m_float.c (100%) rename src/{baseq2 => game}/m_float.h (100%) rename src/{baseq2 => game}/m_flyer.c (100%) rename src/{baseq2 => game}/m_flyer.h (100%) rename src/{baseq2 => game}/m_gladiator.c (100%) rename src/{baseq2 => game}/m_gladiator.h (100%) rename src/{baseq2 => game}/m_gunner.c (100%) rename src/{baseq2 => game}/m_gunner.h (100%) rename src/{baseq2 => game}/m_hover.c (100%) rename src/{baseq2 => game}/m_hover.h (100%) rename src/{baseq2 => game}/m_infantry.c (100%) rename src/{baseq2 => game}/m_infantry.h (100%) rename src/{baseq2 => game}/m_insane.c (100%) rename src/{baseq2 => game}/m_insane.h (100%) rename src/{baseq2 => game}/m_medic.c (100%) rename src/{baseq2 => game}/m_medic.h (100%) rename src/{baseq2 => game}/m_move.c (100%) rename src/{baseq2 => game}/m_mutant.c (100%) rename src/{baseq2 => game}/m_mutant.h (100%) rename src/{baseq2 => game}/m_parasite.c (100%) rename src/{baseq2 => game}/m_parasite.h (100%) rename src/{baseq2 => game}/m_player.h (100%) rename src/{baseq2 => game}/m_rider.h (100%) rename src/{baseq2 => game}/m_soldier.c (100%) rename src/{baseq2 => game}/m_soldier.h (100%) rename src/{baseq2 => game}/m_supertank.c (100%) rename src/{baseq2 => game}/m_supertank.h (100%) rename src/{baseq2 => game}/m_tank.c (100%) rename src/{baseq2 => game}/m_tank.h (100%) rename src/{baseq2 => game}/p_client.c (100%) rename src/{baseq2 => game}/p_hud.c (100%) rename src/{baseq2 => game}/p_trail.c (100%) rename src/{baseq2 => game}/p_view.c (100%) rename src/{baseq2 => game}/p_weapon.c (100%) rename src/windows/res/{baseq2.rc => game.rc} (86%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e344015ce..87651c91c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,83 +4,83 @@ cmake_policy(SET CMP0069 NEW) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) -SET(SRC_BASEQ2 - baseq2/g_ai.c - baseq2/g_chase.c - baseq2/g_cmds.c - baseq2/g_combat.c - baseq2/g_func.c - baseq2/g_items.c - baseq2/g_main.c - baseq2/g_misc.c - baseq2/g_monster.c - baseq2/g_phys.c - baseq2/g_ptrs.c - baseq2/g_ptrs_compat_v2.c - baseq2/g_save.c - baseq2/g_spawn.c - baseq2/g_svcmds.c - baseq2/g_target.c - baseq2/g_trigger.c - baseq2/g_turret.c - baseq2/g_utils.c - baseq2/g_weapon.c - baseq2/m_actor.c - baseq2/m_berserk.c - baseq2/m_boss2.c - baseq2/m_boss3.c - baseq2/m_boss31.c - baseq2/m_boss32.c - baseq2/m_brain.c - baseq2/m_chick.c - baseq2/m_flipper.c - baseq2/m_float.c - baseq2/m_flyer.c - baseq2/m_gladiator.c - baseq2/m_gunner.c - baseq2/m_hover.c - baseq2/m_infantry.c - baseq2/m_insane.c - baseq2/m_medic.c - baseq2/m_move.c - baseq2/m_mutant.c - baseq2/m_parasite.c - baseq2/m_soldier.c - baseq2/m_supertank.c - baseq2/m_tank.c - baseq2/p_client.c - baseq2/p_hud.c - baseq2/p_trail.c - baseq2/p_view.c - baseq2/p_weapon.c +SET(SRC_GAME + game/g_ai.c + game/g_chase.c + game/g_cmds.c + game/g_combat.c + game/g_func.c + game/g_items.c + game/g_main.c + game/g_misc.c + game/g_monster.c + game/g_phys.c + game/g_ptrs.c + game/g_ptrs_compat_v2.c + game/g_save.c + game/g_spawn.c + game/g_svcmds.c + game/g_target.c + game/g_trigger.c + game/g_turret.c + game/g_utils.c + game/g_weapon.c + game/m_actor.c + game/m_berserk.c + game/m_boss2.c + game/m_boss3.c + game/m_boss31.c + game/m_boss32.c + game/m_brain.c + game/m_chick.c + game/m_flipper.c + game/m_float.c + game/m_flyer.c + game/m_gladiator.c + game/m_gunner.c + game/m_hover.c + game/m_infantry.c + game/m_insane.c + game/m_medic.c + game/m_move.c + game/m_mutant.c + game/m_parasite.c + game/m_soldier.c + game/m_supertank.c + game/m_tank.c + game/p_client.c + game/p_hud.c + game/p_trail.c + game/p_view.c + game/p_weapon.c ) -SET(HEADERS_BASEQ2 - baseq2/g_local.h - baseq2/g_ptrs.h - baseq2/m_actor.h - baseq2/m_berserk.h - baseq2/m_boss2.h - baseq2/m_boss31.h - baseq2/m_boss32.h - baseq2/m_brain.h - baseq2/m_chick.h - baseq2/m_flipper.h - baseq2/m_float.h - baseq2/m_flyer.h - baseq2/m_gladiator.h - baseq2/m_gunner.h - baseq2/m_hover.h - baseq2/m_infantry.h - baseq2/m_insane.h - baseq2/m_medic.h - baseq2/m_mutant.h - baseq2/m_parasite.h - baseq2/m_player.h - baseq2/m_rider.h - baseq2/m_soldier.h - baseq2/m_supertank.h - baseq2/m_tank.h +SET(HEADERS_GAME + game/g_local.h + game/g_ptrs.h + game/m_actor.h + game/m_berserk.h + game/m_boss2.h + game/m_boss31.h + game/m_boss32.h + game/m_brain.h + game/m_chick.h + game/m_flipper.h + game/m_float.h + game/m_flyer.h + game/m_gladiator.h + game/m_gunner.h + game/m_hover.h + game/m_infantry.h + game/m_insane.h + game/m_medic.h + game/m_mutant.h + game/m_parasite.h + game/m_player.h + game/m_rider.h + game/m_soldier.h + game/m_supertank.h + game/m_tank.h ) @@ -423,10 +423,10 @@ if(NOT MSVC) # CCompilerFlagString(WARN_MISSING_PROTOTYPES "-Wmissing-prototypes") endif() -ADD_LIBRARY(baseq2 SHARED ${SRC_BASEQ2} ${HEADERS_BASEQ2} ${SRC_SHARED}) +ADD_LIBRARY(game SHARED ${SRC_GAME} ${HEADERS_GAME} ${SRC_SHARED}) if(CMAKE_C_COMPILER_ID STREQUAL "GNU") # Workaround for GCC 10 linking shared libgcc by default - target_link_options(baseq2 PRIVATE "-static-libgcc") + target_link_options(game PRIVATE "-static-libgcc") endif() IF(WIN32) @@ -514,8 +514,8 @@ IF (TARGET client) TARGET_LINK_LIBRARIES(client OpenAL) ENDIF() -SOURCE_GROUP("baseq2\\sources" FILES ${SRC_BASEQ2}) -SOURCE_GROUP("baseq2\\headers" FILES ${HEADERS_BASEQ2}) +SOURCE_GROUP("game\\sources" FILES ${SRC_GAME}) +SOURCE_GROUP("game\\headers" FILES ${HEADERS_GAME}) SOURCE_GROUP("client\\sources" FILES ${SRC_CLIENT}) SOURCE_GROUP("client\\headers" FILES ${HEADERS_CLIENT}) SOURCE_GROUP("server\\sources" FILES ${SRC_SERVER}) @@ -539,8 +539,8 @@ IF (WIN32) ENDIF() TARGET_INCLUDE_DIRECTORIES(server PRIVATE ../VC/inc) - TARGET_INCLUDE_DIRECTORIES(baseq2 PRIVATE ../VC/inc) - TARGET_SOURCES(baseq2 PRIVATE windows/res/baseq2.rc) + TARGET_INCLUDE_DIRECTORIES(game PRIVATE ../VC/inc) + TARGET_SOURCES(game PRIVATE windows/res/game.rc) TARGET_LINK_LIBRARIES(server winmm ws2_32) @@ -548,10 +548,10 @@ IF (WIN32) # macro redefinition, deprecation TARGET_COMPILE_OPTIONS(server PRIVATE /wd4005 /wd4996) - TARGET_COMPILE_OPTIONS(baseq2 PRIVATE /wd4005 /wd4996) + TARGET_COMPILE_OPTIONS(game PRIVATE /wd4005 /wd4996) ENDIF() -TARGET_INCLUDE_DIRECTORIES(baseq2 PRIVATE ../inc) +TARGET_INCLUDE_DIRECTORIES(game PRIVATE ../inc) IF(TARGET client) TARGET_INCLUDE_DIRECTORIES(client PRIVATE ../inc) @@ -567,13 +567,13 @@ if (CONFIG_LINUX_STEAM_RUNTIME_SUPPORT) TARGET_LINK_LIBRARIES(client SDL2main SDL2-static z) ENDIF() TARGET_LINK_LIBRARIES(server z) - TARGET_LINK_LIBRARIES(baseq2 z) + TARGET_LINK_LIBRARIES(game z) else() IF(TARGET client) TARGET_LINK_LIBRARIES(client SDL2main SDL2-static zlibstatic) ENDIF() TARGET_LINK_LIBRARIES(server zlibstatic) - TARGET_LINK_LIBRARIES(baseq2 zlibstatic) + TARGET_LINK_LIBRARIES(game zlibstatic) endif() IF(UNIX) @@ -611,7 +611,7 @@ ENDIF() # specify both LIBRARY and RUNTIME because one works only on Windows and another works only on Linux -SET_TARGET_PROPERTIES(baseq2 +SET_TARGET_PROPERTIES(game PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/baseq2" LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/baseq2" @@ -629,26 +629,26 @@ SET_TARGET_PROPERTIES(baseq2 IF(IS_64_BIT) IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") - SET_TARGET_PROPERTIES(baseq2 + SET_TARGET_PROPERTIES(game PROPERTIES LIBRARY_OUTPUT_NAME "gameaarch64" RUNTIME_OUTPUT_NAME "gameaarch64" ) ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") - SET_TARGET_PROPERTIES(baseq2 + SET_TARGET_PROPERTIES(game PROPERTIES LIBRARY_OUTPUT_NAME "gameppc64le" RUNTIME_OUTPUT_NAME "gameppc64le" ) ELSE() - SET_TARGET_PROPERTIES(baseq2 + SET_TARGET_PROPERTIES(game PROPERTIES LIBRARY_OUTPUT_NAME "gamex86_64" RUNTIME_OUTPUT_NAME "gamex86_64" ) ENDIF() ELSE() - SET_TARGET_PROPERTIES(baseq2 + SET_TARGET_PROPERTIES(game PROPERTIES LIBRARY_OUTPUT_NAME "gamex86" RUNTIME_OUTPUT_NAME "gamex86" @@ -669,7 +669,7 @@ IF(CONFIG_LINUX_PACKAGING_SUPPORT) SCRIPT "${CMAKE_SOURCE_DIR}/setup/package_shaders.cmake" COMPONENT shareware) ENDIF() - INSTALL(TARGETS baseq2 DESTINATION share/quake2rtx/baseq2 COMPONENT shareware) + INSTALL(TARGETS game DESTINATION share/quake2rtx/baseq2 COMPONENT shareware) # Package data files, including the shareware pak0 for demo levels set (SHAREWARE_DATA_FILES_LIST diff --git a/src/baseq2/g_ai.c b/src/game/g_ai.c similarity index 100% rename from src/baseq2/g_ai.c rename to src/game/g_ai.c diff --git a/src/baseq2/g_chase.c b/src/game/g_chase.c similarity index 100% rename from src/baseq2/g_chase.c rename to src/game/g_chase.c diff --git a/src/baseq2/g_cmds.c b/src/game/g_cmds.c similarity index 100% rename from src/baseq2/g_cmds.c rename to src/game/g_cmds.c diff --git a/src/baseq2/g_combat.c b/src/game/g_combat.c similarity index 100% rename from src/baseq2/g_combat.c rename to src/game/g_combat.c diff --git a/src/baseq2/g_func.c b/src/game/g_func.c similarity index 100% rename from src/baseq2/g_func.c rename to src/game/g_func.c diff --git a/src/baseq2/g_items.c b/src/game/g_items.c similarity index 100% rename from src/baseq2/g_items.c rename to src/game/g_items.c diff --git a/src/baseq2/g_local.h b/src/game/g_local.h similarity index 100% rename from src/baseq2/g_local.h rename to src/game/g_local.h diff --git a/src/baseq2/g_main.c b/src/game/g_main.c similarity index 100% rename from src/baseq2/g_main.c rename to src/game/g_main.c diff --git a/src/baseq2/g_misc.c b/src/game/g_misc.c similarity index 100% rename from src/baseq2/g_misc.c rename to src/game/g_misc.c diff --git a/src/baseq2/g_monster.c b/src/game/g_monster.c similarity index 100% rename from src/baseq2/g_monster.c rename to src/game/g_monster.c diff --git a/src/baseq2/g_phys.c b/src/game/g_phys.c similarity index 100% rename from src/baseq2/g_phys.c rename to src/game/g_phys.c diff --git a/src/baseq2/g_ptrs.c b/src/game/g_ptrs.c similarity index 100% rename from src/baseq2/g_ptrs.c rename to src/game/g_ptrs.c diff --git a/src/baseq2/g_ptrs.h b/src/game/g_ptrs.h similarity index 100% rename from src/baseq2/g_ptrs.h rename to src/game/g_ptrs.h diff --git a/src/baseq2/g_ptrs_compat_v2.c b/src/game/g_ptrs_compat_v2.c similarity index 100% rename from src/baseq2/g_ptrs_compat_v2.c rename to src/game/g_ptrs_compat_v2.c diff --git a/src/baseq2/g_save.c b/src/game/g_save.c similarity index 100% rename from src/baseq2/g_save.c rename to src/game/g_save.c diff --git a/src/baseq2/g_spawn.c b/src/game/g_spawn.c similarity index 100% rename from src/baseq2/g_spawn.c rename to src/game/g_spawn.c diff --git a/src/baseq2/g_svcmds.c b/src/game/g_svcmds.c similarity index 100% rename from src/baseq2/g_svcmds.c rename to src/game/g_svcmds.c diff --git a/src/baseq2/g_target.c b/src/game/g_target.c similarity index 100% rename from src/baseq2/g_target.c rename to src/game/g_target.c diff --git a/src/baseq2/g_trigger.c b/src/game/g_trigger.c similarity index 100% rename from src/baseq2/g_trigger.c rename to src/game/g_trigger.c diff --git a/src/baseq2/g_turret.c b/src/game/g_turret.c similarity index 100% rename from src/baseq2/g_turret.c rename to src/game/g_turret.c diff --git a/src/baseq2/g_utils.c b/src/game/g_utils.c similarity index 100% rename from src/baseq2/g_utils.c rename to src/game/g_utils.c diff --git a/src/baseq2/g_weapon.c b/src/game/g_weapon.c similarity index 100% rename from src/baseq2/g_weapon.c rename to src/game/g_weapon.c diff --git a/src/baseq2/genptr.py b/src/game/genptr.py similarity index 100% rename from src/baseq2/genptr.py rename to src/game/genptr.py diff --git a/src/baseq2/m_actor.c b/src/game/m_actor.c similarity index 100% rename from src/baseq2/m_actor.c rename to src/game/m_actor.c diff --git a/src/baseq2/m_actor.h b/src/game/m_actor.h similarity index 100% rename from src/baseq2/m_actor.h rename to src/game/m_actor.h diff --git a/src/baseq2/m_berserk.c b/src/game/m_berserk.c similarity index 100% rename from src/baseq2/m_berserk.c rename to src/game/m_berserk.c diff --git a/src/baseq2/m_berserk.h b/src/game/m_berserk.h similarity index 100% rename from src/baseq2/m_berserk.h rename to src/game/m_berserk.h diff --git a/src/baseq2/m_boss2.c b/src/game/m_boss2.c similarity index 100% rename from src/baseq2/m_boss2.c rename to src/game/m_boss2.c diff --git a/src/baseq2/m_boss2.h b/src/game/m_boss2.h similarity index 100% rename from src/baseq2/m_boss2.h rename to src/game/m_boss2.h diff --git a/src/baseq2/m_boss3.c b/src/game/m_boss3.c similarity index 100% rename from src/baseq2/m_boss3.c rename to src/game/m_boss3.c diff --git a/src/baseq2/m_boss31.c b/src/game/m_boss31.c similarity index 100% rename from src/baseq2/m_boss31.c rename to src/game/m_boss31.c diff --git a/src/baseq2/m_boss31.h b/src/game/m_boss31.h similarity index 100% rename from src/baseq2/m_boss31.h rename to src/game/m_boss31.h diff --git a/src/baseq2/m_boss32.c b/src/game/m_boss32.c similarity index 100% rename from src/baseq2/m_boss32.c rename to src/game/m_boss32.c diff --git a/src/baseq2/m_boss32.h b/src/game/m_boss32.h similarity index 100% rename from src/baseq2/m_boss32.h rename to src/game/m_boss32.h diff --git a/src/baseq2/m_brain.c b/src/game/m_brain.c similarity index 100% rename from src/baseq2/m_brain.c rename to src/game/m_brain.c diff --git a/src/baseq2/m_brain.h b/src/game/m_brain.h similarity index 100% rename from src/baseq2/m_brain.h rename to src/game/m_brain.h diff --git a/src/baseq2/m_chick.c b/src/game/m_chick.c similarity index 100% rename from src/baseq2/m_chick.c rename to src/game/m_chick.c diff --git a/src/baseq2/m_chick.h b/src/game/m_chick.h similarity index 100% rename from src/baseq2/m_chick.h rename to src/game/m_chick.h diff --git a/src/baseq2/m_flipper.c b/src/game/m_flipper.c similarity index 100% rename from src/baseq2/m_flipper.c rename to src/game/m_flipper.c diff --git a/src/baseq2/m_flipper.h b/src/game/m_flipper.h similarity index 100% rename from src/baseq2/m_flipper.h rename to src/game/m_flipper.h diff --git a/src/baseq2/m_float.c b/src/game/m_float.c similarity index 100% rename from src/baseq2/m_float.c rename to src/game/m_float.c diff --git a/src/baseq2/m_float.h b/src/game/m_float.h similarity index 100% rename from src/baseq2/m_float.h rename to src/game/m_float.h diff --git a/src/baseq2/m_flyer.c b/src/game/m_flyer.c similarity index 100% rename from src/baseq2/m_flyer.c rename to src/game/m_flyer.c diff --git a/src/baseq2/m_flyer.h b/src/game/m_flyer.h similarity index 100% rename from src/baseq2/m_flyer.h rename to src/game/m_flyer.h diff --git a/src/baseq2/m_gladiator.c b/src/game/m_gladiator.c similarity index 100% rename from src/baseq2/m_gladiator.c rename to src/game/m_gladiator.c diff --git a/src/baseq2/m_gladiator.h b/src/game/m_gladiator.h similarity index 100% rename from src/baseq2/m_gladiator.h rename to src/game/m_gladiator.h diff --git a/src/baseq2/m_gunner.c b/src/game/m_gunner.c similarity index 100% rename from src/baseq2/m_gunner.c rename to src/game/m_gunner.c diff --git a/src/baseq2/m_gunner.h b/src/game/m_gunner.h similarity index 100% rename from src/baseq2/m_gunner.h rename to src/game/m_gunner.h diff --git a/src/baseq2/m_hover.c b/src/game/m_hover.c similarity index 100% rename from src/baseq2/m_hover.c rename to src/game/m_hover.c diff --git a/src/baseq2/m_hover.h b/src/game/m_hover.h similarity index 100% rename from src/baseq2/m_hover.h rename to src/game/m_hover.h diff --git a/src/baseq2/m_infantry.c b/src/game/m_infantry.c similarity index 100% rename from src/baseq2/m_infantry.c rename to src/game/m_infantry.c diff --git a/src/baseq2/m_infantry.h b/src/game/m_infantry.h similarity index 100% rename from src/baseq2/m_infantry.h rename to src/game/m_infantry.h diff --git a/src/baseq2/m_insane.c b/src/game/m_insane.c similarity index 100% rename from src/baseq2/m_insane.c rename to src/game/m_insane.c diff --git a/src/baseq2/m_insane.h b/src/game/m_insane.h similarity index 100% rename from src/baseq2/m_insane.h rename to src/game/m_insane.h diff --git a/src/baseq2/m_medic.c b/src/game/m_medic.c similarity index 100% rename from src/baseq2/m_medic.c rename to src/game/m_medic.c diff --git a/src/baseq2/m_medic.h b/src/game/m_medic.h similarity index 100% rename from src/baseq2/m_medic.h rename to src/game/m_medic.h diff --git a/src/baseq2/m_move.c b/src/game/m_move.c similarity index 100% rename from src/baseq2/m_move.c rename to src/game/m_move.c diff --git a/src/baseq2/m_mutant.c b/src/game/m_mutant.c similarity index 100% rename from src/baseq2/m_mutant.c rename to src/game/m_mutant.c diff --git a/src/baseq2/m_mutant.h b/src/game/m_mutant.h similarity index 100% rename from src/baseq2/m_mutant.h rename to src/game/m_mutant.h diff --git a/src/baseq2/m_parasite.c b/src/game/m_parasite.c similarity index 100% rename from src/baseq2/m_parasite.c rename to src/game/m_parasite.c diff --git a/src/baseq2/m_parasite.h b/src/game/m_parasite.h similarity index 100% rename from src/baseq2/m_parasite.h rename to src/game/m_parasite.h diff --git a/src/baseq2/m_player.h b/src/game/m_player.h similarity index 100% rename from src/baseq2/m_player.h rename to src/game/m_player.h diff --git a/src/baseq2/m_rider.h b/src/game/m_rider.h similarity index 100% rename from src/baseq2/m_rider.h rename to src/game/m_rider.h diff --git a/src/baseq2/m_soldier.c b/src/game/m_soldier.c similarity index 100% rename from src/baseq2/m_soldier.c rename to src/game/m_soldier.c diff --git a/src/baseq2/m_soldier.h b/src/game/m_soldier.h similarity index 100% rename from src/baseq2/m_soldier.h rename to src/game/m_soldier.h diff --git a/src/baseq2/m_supertank.c b/src/game/m_supertank.c similarity index 100% rename from src/baseq2/m_supertank.c rename to src/game/m_supertank.c diff --git a/src/baseq2/m_supertank.h b/src/game/m_supertank.h similarity index 100% rename from src/baseq2/m_supertank.h rename to src/game/m_supertank.h diff --git a/src/baseq2/m_tank.c b/src/game/m_tank.c similarity index 100% rename from src/baseq2/m_tank.c rename to src/game/m_tank.c diff --git a/src/baseq2/m_tank.h b/src/game/m_tank.h similarity index 100% rename from src/baseq2/m_tank.h rename to src/game/m_tank.h diff --git a/src/baseq2/p_client.c b/src/game/p_client.c similarity index 100% rename from src/baseq2/p_client.c rename to src/game/p_client.c diff --git a/src/baseq2/p_hud.c b/src/game/p_hud.c similarity index 100% rename from src/baseq2/p_hud.c rename to src/game/p_hud.c diff --git a/src/baseq2/p_trail.c b/src/game/p_trail.c similarity index 100% rename from src/baseq2/p_trail.c rename to src/game/p_trail.c diff --git a/src/baseq2/p_view.c b/src/game/p_view.c similarity index 100% rename from src/baseq2/p_view.c rename to src/game/p_view.c diff --git a/src/baseq2/p_weapon.c b/src/game/p_weapon.c similarity index 100% rename from src/baseq2/p_weapon.c rename to src/game/p_weapon.c diff --git a/src/windows/res/baseq2.rc b/src/windows/res/game.rc similarity index 86% rename from src/windows/res/baseq2.rc rename to src/windows/res/game.rc index 316ac88bb..41003769c 100644 --- a/src/windows/res/baseq2.rc +++ b/src/windows/res/game.rc @@ -12,7 +12,7 @@ #define VER_FILEFLAGS 0x0L #endif -#define VER_FILEDESCRIPTION_STR "Q2RTX baseq2 Game Module " LONG_VERSION_STRING +#define VER_FILEDESCRIPTION_STR "Q2RTX game Module " LONG_VERSION_STRING #define VER_ORIGINALFILENAME_STR "gamex86_64.dll" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US @@ -34,8 +34,8 @@ BEGIN VALUE "FileDescription", VER_FILEDESCRIPTION_STR VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR VALUE "FileVersion", VERSION_STRING - VALUE "InternalName", "baseq2" - VALUE "LegalCopyright", "Copyright (C) 2019-2020, NVIDIA CORPORATION. All rights reserved." + VALUE "InternalName", "game" + VALUE "LegalCopyright", "Copyright (C) 2019-2023, NVIDIA CORPORATION. All rights reserved." VALUE "ProductName", "Quake II RTX" VALUE "ProductVersion", VERSION_STRING END