From: Mario Date: Thu, 29 Aug 2013 09:48:41 +0000 (+1000) Subject: Remove some unused code X-Git-Tag: xonotic-v0.8.0~241^2^2~147 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0ded465b923f9e51db5bf62c271488e64e2a3f2c;p=xonotic%2Fxonotic-data.pk3dir.git Remove some unused code --- diff --git a/commands.cfg b/commands.cfg index 9cbad2a63..ee71c70f3 100644 --- a/commands.cfg +++ b/commands.cfg @@ -56,6 +56,7 @@ alias who "qc_cmd_svcmd who ${* ?}" // Displa // generic commands (across all programs) alias addtolist "qc_cmd_svmenu addtolist ${* ?}" // Add a string to a cvar alias dumpcommands "qc_cmd_svmenu dumpcommands ${* ?}" // Dump all commands on the program to *_cmd_dump.txt +alias dumpmonsters "qc_cmd_svmenu dumpmonsters ${* ?}" // Dump all monsters into monsters_dump.txt alias dumpnotifs "qc_cmd_svcl dumpnotifs ${* ?}" // Dump all notifications into notifications_dump.txt alias maplist "qc_cmd_svmenu maplist ${* ?}" // Automatic control of maplist alias nextframe "qc_cmd_svmenu nextframe ${* ?}" // Execute the given command next frame of this VM @@ -178,10 +179,6 @@ alias spec "spectate" // mutator aliases alias sandbox "cmd g_sandbox ${* ?}" -alias spawnturret "cmd turretspawn ${* ?}" -alias upgradeturret "cmd buffturret ${* ?}" -alias rmturret "cmd turretremove ${* ?}" -alias repairturret "cmd repairturret ${* ?}" // ============================================================ @@ -193,7 +190,7 @@ alias allspec "qc_cmd_sv allspec ${* ?}" // Force alias anticheat "qc_cmd_sv anticheat ${* ?}" // Create an anticheat report for a client alias bbox "qc_cmd_sv bbox ${* ?}" // Print detailed information about world size alias bot_cmd "qc_cmd_sv bot_cmd ${* ?}" // Control and send commands to bots -alias butcher "qc_cmd_sv butcher ${* ?}" // Remove all monsters on the map +alias butcher "qc_cmd_sv butcher ${* ?}" // Remove all monsters on the map alias cointoss "qc_cmd_sv cointoss ${* ?}" // Flip a virtual coin and give random result alias database "qc_cmd_sv database ${* ?}" // Extra controls of the serverprogs database alias defer_clear "qc_cmd_sv defer_clear ${* ?}" // Clear all queued defer commands for a specific client diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 9d5b9f4d6..1520b1284 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -430,8 +430,6 @@ seta menu_monsters_edit_skin 0 seta menu_monsters_edit_color "" seta menu_monsters_edit_movetarget 1 -seta menu_td_edit_spawn "" - set g_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps" set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps" diff --git a/models/td/barricade.md3 b/models/td/barricade.md3 deleted file mode 100644 index 8d58d9b60..000000000 Binary files a/models/td/barricade.md3 and /dev/null differ diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 104c44252..14e0dbc67 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -1069,15 +1069,10 @@ vector HUD_DrawKeyValue(vector pos, string key, string value) { vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { float stat_secrets_found, stat_secrets_total; - float stat_current_wave, stat_totalwaves; float stat_monsters_killed, stat_monsters_total; float rows = 0; string val; - // get tower defense stats - stat_current_wave = getstatf(STAT_CURRENT_WAVE); - stat_totalwaves = getstatf(STAT_TOTALWAVES); - // get monster stats stat_monsters_killed = getstatf(STAT_MONSTERS_KILLED); stat_monsters_total = getstatf(STAT_MONSTERS_TOTAL); @@ -1113,13 +1108,6 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL); drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL); - // draw waves - if(stat_totalwaves) - { - val = sprintf("%d/%d", stat_current_wave, stat_totalwaves); - pos = HUD_DrawKeyValue(pos, _("Current wave:"), val); - } - // draw monsters if(stat_monsters_total) { diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 22ba6a56f..74f3da079 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -182,11 +182,8 @@ const float STAT_SECRETS_FOUND = 71; const float STAT_RESPAWN_TIME = 72; const float STAT_ROUNDSTARTTIME = 73; -const float STAT_CURRENT_WAVE = 73; -const float STAT_TOTALWAVES = 74; - -const float STAT_MONSTERS_TOTAL = 75; -const float STAT_MONSTERS_KILLED = 76; +const float STAT_MONSTERS_TOTAL = 73; +const float STAT_MONSTERS_KILLED = 74; // mod stats (1xx) const float STAT_REDALIVE = 100; diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 2b99630d5..81a4f5a7e 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -88,7 +88,7 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright, vector org; float lag; - if(player.hitplotfh >= 0 && !(player.flags & FL_MONSTER)) + if(player.hitplotfh >= 0) { lag = ANTILAG_LATENCY(player); if(lag < 0.001) @@ -1017,8 +1017,6 @@ vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float f void W_AttachToShotorg(entity flash, vector offset) { - if(self.flags & FL_MONSTER) - return; // no flash for monsters entity xflash; flash.owner = self; flash.angles_z = random() * 360; @@ -1282,9 +1280,6 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload) { - if(self.flags & FL_MONSTER) // no ammo for monsters... yet - return; - if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !ammo_reload) return; diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index ce049adf3..68b1457fc 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -196,7 +196,7 @@ void ClientCommand_mobedit(float request, float argc) switch(argv(1)) { - case "name": trace_ent.netname = strzone(strdecolorize(argv(2))); if(trace_ent.sprite) WaypointSprite_UpdateSprites(trace_ent.sprite, trace_ent.netname, "", ""); return; + case "name": trace_ent.monster_name = strzone(strdecolorize(argv(2))); if(trace_ent.sprite) WaypointSprite_UpdateSprites(trace_ent.sprite, trace_ent.monster_name, "", ""); return; case "skin": if(trace_ent.monsterid != MON_MAGE) { trace_ent.skin = stof(argv(2)); trace_ent.SendFlags |= MSF_STATUS; } return; case "movetarget": trace_ent.monster_moveflags = stof(argv(2)); return; } @@ -228,7 +228,7 @@ void ClientCommand_mobkill(float request) sprint(self, "That monster does not belong to you.\n"); return; } - sprint(self, strcat("Your pet '", trace_ent.netname, "' has been brutally mutilated.\n")); + sprint(self, strcat("Your pet '", trace_ent.monster_name, "' has been brutally mutilated.\n")); Damage (trace_ent, world, world, trace_ent.health + trace_ent.max_health + 200, DEATH_KILL, trace_ent.origin, '0 0 0'); return; } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 2175ceb42..508dd1786 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -149,21 +149,21 @@ void GameCommand_butcher(float request) if(g_invasion) { print("This command doesn't work during an invasion.\n"); return; } float removed_count = 0; - entity montokill, head; + entity head; - FOR_EACH_MONSTER(montokill) - { - WaypointSprite_Kill(montokill.sprite); + FOR_EACH_MONSTER(head) + { + WaypointSprite_Kill(head.sprite); - if(montokill.weaponentity) - remove(montokill.weaponentity); + if(head.weaponentity) + remove(head.weaponentity); + + if(head.iceblock) + remove(head.iceblock); - if(montokill.iceblock) - remove(montokill.iceblock); - - remove(montokill); - removed_count += 1; - } + remove(head); + ++removed_count; + } FOR_EACH_PLAYER(head) head.monstercount = 0; @@ -1780,7 +1780,7 @@ void GameCommand_(float request) // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;) #define SERVER_COMMANDS(request,arguments,command) \ SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \ - SERVER_COMMAND("butcher", GameCommand_butcher(request), "Instantly removes all monsters on the map") \ + SERVER_COMMAND("butcher", GameCommand_butcher(request), "Instantly removes all monsters on the map") \ SERVER_COMMAND("allready", GameCommand_allready(request), "Restart the server and reset the players") \ SERVER_COMMAND("allspec", GameCommand_allspec(request, arguments), "Force all players to spectate") \ SERVER_COMMAND("anticheat", GameCommand_anticheat(request, arguments), "Create an anticheat report for a client") \ diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 2e100f2ce..56cac627f 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -552,10 +552,7 @@ void Ice_Think() void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint) { - float monster = (targ.flags & FL_MONSTER); - float player = (targ.flags & FL_CLIENT); - - if(!player && !monster) // only specified entities can be freezed + if(!IS_PLAYER(targ) && !(targ.flags & FL_MONSTER)) // only specified entities can be freezed return; if(targ.frozen) @@ -595,18 +592,19 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo void Unfreeze (entity targ) { - if not(targ.frozen) - return; // not even frozen? - + if(targ.frozen) // only reset health if target was frozen + targ.health = ((IS_PLAYER(targ)) ? autocvar_g_balance_health_start : targ.max_health); targ.frozen = 0; targ.revive_progress = 0; - targ.health = ((targ.classname == STR_PLAYER) ? autocvar_g_balance_health_start : targ.max_health); WaypointSprite_Kill(targ.waypointsprite_attached); // remove the ice block - remove(targ.iceblock); - targ.iceblock = world; + if(targ.iceblock) + { + remove(targ.iceblock); + targ.iceblock = world; + } } // these are updated by each Damage call for use in button triggering and such diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 3ff0fc96c..f4d1c31cf 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -814,8 +814,6 @@ void ctf_FlagTouch() entity toucher = other; - if(toucher.frozen) { return; } - // automatically kill the flag and return it if it touched lava/slime/nodrop surfaces if(ITEM_TOUCH_NEEDKILL()) { @@ -825,7 +823,8 @@ void ctf_FlagTouch() } // special touch behaviors - if(toucher.vehicle_flags & VHF_ISVEHICLE) + if(toucher.frozen) { return; } + else if(toucher.vehicle_flags & VHF_ISVEHICLE) { if(autocvar_g_ctf_allow_vehicle_touch) toucher = toucher.owner; // the player is actually the vehicle owner, not other diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index ead918c44..95c384919 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -406,9 +406,9 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink) n = 0; FOR_EACH_PLAYER(other) if(self != other) { - if(!other.frozen) + if(other.frozen == 0) { - if(other.team == self.team) + if(!IsDifferentTeam(other, self)) { if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax)) { diff --git a/qcsrc/server/tturrets/system/system_damage.qc b/qcsrc/server/tturrets/system/system_damage.qc index d561862d0..837f50a07 100644 --- a/qcsrc/server/tturrets/system/system_damage.qc +++ b/qcsrc/server/tturrets/system/system_damage.qc @@ -66,7 +66,6 @@ void turret_stdproc_respawn() self.tur_head.avelocity = self.avelocity; self.tur_head.angles = self.idle_aim; self.health = self.tur_health; - self.max_health = self.tur_health; self.enemy = world; self.volly_counter = self.shot_volly; diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index b5dfba6a9..5763e888f 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -1110,7 +1110,6 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa if not (self.health) self.health = 1000; self.tur_health = max(1, self.health); - self.max_health = self.tur_health; self.bot_attack = TRUE; self.monster_attack = TRUE; diff --git a/qcsrc/server/tturrets/units/unit_fusionreactor.qc b/qcsrc/server/tturrets/units/unit_fusionreactor.qc index 5268ff054..5954384b2 100644 --- a/qcsrc/server/tturrets/units/unit_fusionreactor.qc +++ b/qcsrc/server/tturrets/units/unit_fusionreactor.qc @@ -46,7 +46,7 @@ float turret_fusionreactor_firecheck() if (self.enemy.ammo >= self.enemy.ammo_max) return 0; - if(teamplay && IsDifferentTeam(self, self.enemy)) + if(IsDifferentTeam(self, self.enemy)) return 0; if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY) diff --git a/qcsrc/server/tturrets/units/unit_walker.qc b/qcsrc/server/tturrets/units/unit_walker.qc index 3511a2dcd..20100de04 100644 --- a/qcsrc/server/tturrets/units/unit_walker.qc +++ b/qcsrc/server/tturrets/units/unit_walker.qc @@ -107,7 +107,7 @@ void walker_rocket_think() m_speed = vlen(self.velocity); // Enemy dead? just keep on the current heading then. - if (self.enemy == world || self.enemy.deadflag != DEAD_NO || self.enemy.classname == "td_generator") + if (self.enemy == world || self.enemy.deadflag != DEAD_NO) self.enemy = world; if (self.enemy) diff --git a/scripts/barricade.shader b/scripts/barricade.shader deleted file mode 100644 index c650b5bec..000000000 --- a/scripts/barricade.shader +++ /dev/null @@ -1,8 +0,0 @@ -barricade -{ - cull none - { - map textures/barricade.tga - } -} - diff --git a/scripts/shaderlist.txt b/scripts/shaderlist.txt index 831a6673f..ce11875b7 100644 --- a/scripts/shaderlist.txt +++ b/scripts/shaderlist.txt @@ -14,6 +14,5 @@ tree tuba turrets weapons -barricade monsters ok_nade_counter diff --git a/textures/barricade.tga b/textures/barricade.tga deleted file mode 100644 index d9cd7748a..000000000 Binary files a/textures/barricade.tga and /dev/null differ diff --git a/textures/barricade_norm.tga b/textures/barricade_norm.tga deleted file mode 100644 index e664ed49c..000000000 Binary files a/textures/barricade_norm.tga and /dev/null differ