From: terencehill Date: Tue, 27 Apr 2021 12:43:15 +0000 (+0200) Subject: Misc minor cleanups X-Git-Tag: xonotic-v0.8.5~430 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=acc08b9655874164549bc2600f78c6edbc3c084a;p=xonotic%2Fxonotic-data.pk3dir.git Misc minor cleanups --- diff --git a/qcsrc/client/hud/panel/ammo.qc b/qcsrc/client/hud/panel/ammo.qc index ed2b6e033..b4a7b6040 100644 --- a/qcsrc/client/hud/panel/ammo.qc +++ b/qcsrc/client/hud/panel/ammo.qc @@ -115,7 +115,7 @@ void HUD_Ammo() { if((!autocvar_hud_panel_ammo) || (spectatee_status == -1)) return; - if(STAT(HEALTH) < 1 && autocvar_hud_panel_ammo_hide_ondeath) + if(STAT(HEALTH) <= 0 && autocvar_hud_panel_ammo_hide_ondeath) return; } diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index abc367d51..22a4d94c3 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -138,7 +138,9 @@ void Inventory_new(PlayerState this) { Inventory inv = NEW(Inventory); setcefc(inv, Inventory_customize); - Net_LinkEntity((inv.owner = this).inventory = inv, false, 0, Inventory_Send); + this.inventory = inv; + inv.owner = this; + Net_LinkEntity(inv, false, 0, Inventory_Send); } void Inventory_delete(entity e) { delete(e.inventory); } void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; } diff --git a/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc b/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc index f53d8c356..0cce4e443 100644 --- a/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc +++ b/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc @@ -62,7 +62,10 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink) if(player.vehicle) Damage(player.vehicle, NULL, NULL, autocvar_g_campcheck_damage * 2, DEATH_CAMP.m_id, DMG_NOWEP, player.vehicle.origin, '0 0 0'); else - Damage(player, NULL, NULL, bound(0, autocvar_g_campcheck_damage, GetResource(player, RES_HEALTH) + GetResource(player, RES_ARMOR) * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP.m_id, DMG_NOWEP, player.origin, '0 0 0'); + { + float max_dmg = GetResource(player, RES_HEALTH) + GetResource(player, RES_ARMOR) * autocvar_g_balance_armor_blockpercent + 5; + Damage(player, NULL, NULL, bound(0, autocvar_g_campcheck_damage, max_dmg), DEATH_CAMP.m_id, DMG_NOWEP, player.origin, '0 0 0'); + } } player.campcheck_nextcheck = time + autocvar_g_campcheck_interval; player.campcheck_traveled_distance = 0; diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 986571499..9edfcad60 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -295,7 +295,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_INFO_NOTIF(DEATH_MURDER_VH_WAKI_ROCKET, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_death", _("^BG%s%s^K1 couldn't find shelter from ^BG%s^K1's Racer%s%s"), "") MSG_INFO_NOTIF(DEATH_MURDER_VOID, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_void", _("^BG%s%s^K1 was thrown into a world of hurt by ^BG%s^K1%s%s"), "") - MSG_INFO_NOTIF(DEATH_SELF_AUTOTEAMCHANGE, N_CONSOLE, 2, 1, "s1 death_team s2loc", "", "", _("^BG%s^K1 was moved into the %s%s"), "") /// broken too? + MSG_INFO_NOTIF(DEATH_SELF_AUTOTEAMCHANGE, N_CONSOLE, 2, 1, "s1 death_team s2loc", "", "", _("^BG%s^K1 was moved into the %s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_BETRAYAL, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_teamkill_red", _("^BG%s^K1 became enemies with the Lord of Teamplay%s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_CAMP, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_camping", _("^BG%s^K1 thought they found a nice camping ground%s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_CHEAT, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_selfkill", _("^BG%s^K1 unfairly eliminated themself%s%s"), "") @@ -324,7 +324,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_INFO_NOTIF(DEATH_SELF_SLIME, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_slime", _("^BG%s^K1 was slimed%s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_SUICIDE, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_selfkill", _("^BG%s^K1 couldn't take it anymore%s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_SWAMP, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_slime", _("^BG%s^K1 is now preserved for centuries to come%s%s"), "") - MSG_INFO_NOTIF(DEATH_SELF_TEAMCHANGE, N_CONSOLE, 2, 1, "s1 death_team s2loc", "", "", _("^BG%s^K1 switched to the %s%s"), "") /// broken + MSG_INFO_NOTIF(DEATH_SELF_TEAMCHANGE, N_CONSOLE, 2, 1, "s1 death_team s2loc", "", "", _("^BG%s^K1 switched to the %s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_TOUCHEXPLODE, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_death", _("^BG%s^K1 died in an accident%s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_TURRET, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_death", _("^BG%s^K1 ran into a turret%s%s"), "") MSG_INFO_NOTIF(DEATH_SELF_TURRET_EWHEEL, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_death", _("^BG%s^K1 was blasted away by an eWheel turret%s%s"), "") diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 9f8ef342f..ffc81c468 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -715,7 +715,11 @@ int VoteCommand_parse(entity caller, string vote_command, string vote_list, floa vote_parsed_command = strcat(first_command, " # ", ftos(etof(victim)), " ", command_arguments); vote_parsed_display = sprintf("^1%s #%d ^7%s^1 %s", first_command, etof(victim), victim.netname, reason); } - else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return 0; } + else + { + print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); + return 0; + } break; } @@ -803,7 +807,9 @@ void VoteCommand_abstain(int request, entity caller) // CLIENT ONLY print_to(caller, "^1You abstained from your vote."); caller.vote_selection = VOTE_SELECT_ABSTAIN; msg_entity = caller; - if (!autocvar_sv_vote_singlecount) VoteCount(false); } + if (!autocvar_sv_vote_singlecount) + VoteCount(false); + } return; }