Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ globals = {
"ACT_GMOD_GESTURE_WAVE",
"ACT_GMOD_IN_CHAT",
"ACT_GMOD_TAUNT_CHEER",
"ACT_GMOD_TAUNT_DANCE",
"ACT_MP_ATTACK_CROUCH_PRIMARYFIRE",
"ACT_MP_ATTACK_STAND_PRIMARYFIRE",
"ACT_MP_STAND_IDLE",
Expand Down
2 changes: 2 additions & 0 deletions CONVARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,8 @@ ttt_scoreboard_score 0 // Whether to show the sc
ttt_round_summary_tabs summary,hilite,events,scores // The tabs to show in the round summary screen. Changing the order of the values will change the order of the tabs. Excluding a value from the comma-delimited list will prevent that tab from showing. Invalid values will be ignored. Round must be restarted for changes to take effect

// Misc.
ttt_disable_headshots 0 // Whether to disable the headshot damage multiplier
ttt_disable_mapwin 0 // Whether to disable the ability for maps to set the round winner directly
ttt_death_notifier_enabled 1 // Whether the name and role of a player's killer should be shown to the victim
ttt_death_notifier_show_role 1 // Whether to show the killer's role in death notification messages
ttt_death_notifier_show_team 0 // Whether to show the killer's team in death notification messages (only used when "ttt_death_notifier_show_role" is disabled)
Expand Down
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Fixed jester, detective, innocent, and traitor role rename ConVars not working
- Fixed error in Cannibal's role weapon HUD when weapon was selected from last round (Thanks Stig!)
- Fixed detective hats not hiding when the owning player was eaten by the Cannibal
- Fixed Loot Goblin not being able to drop some weapons that were droppable
- Ported "Add check for checking weapon GetHeadshotMultiplier"

### Developer
Expand Down
12 changes: 12 additions & 0 deletions docs/tutorials/configuring_convars.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,18 @@ <h3 id="miscellaneous-convars">Miscellaneous ConVars</h3>
<td>Boolean</td>
<td>Whether to show the killer's team in death notification messages. <i>(Only used when <code>ttt_death_notifier_show_role</code> is disabled.)</i></td>
</tr>
<tr>
<td>ttt_disable_headshots</td>
<td>0</td>
<td>Boolean</td>
<td>Whether to disable the headshot damage multiplier.</td>
</tr>
<tr>
<td>ttt_disable_mapwin</td>
<td>0</td>
<td>Boolean</td>
<td>Whether to disable the ability for maps to set the round winner directly.</td>
</tr>
<tr>
<td>ttt_smokegrenade_extinguish</td>
<td>1</td>
Expand Down
26 changes: 19 additions & 7 deletions gamemodes/terrortown/gamemode/roles/lootgoblin/lootgoblin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,16 @@ local function StartGoblinTimers()
local wep = nil
-- Loop in here so we get a different weapon for each loot goblin (if there are multiple)
for _, v in RandomPairs(weps) do
if v and not v.AutoSpawnable and v.CanBuy and #v.CanBuy > 0 and v.AllowDrop then
wep = WEPS.GetClass(v)
break
end
if not v then continue end

-- Only allow weapons that can be bought, can be dropped, and don't spawn on their own
-- Specifically check AllowDrop for `false` because weapons in this list don't have the base table
-- applied and the base table has AllowDrop defaulting to `true`
if v.AutoSpawnable or v.AllowDrop == false then continue end
if not v.CanBuy or #v.CanBuy == 0 then continue end

wep = WEPS.GetClass(v)
break
end

-- Sanity check
Expand Down Expand Up @@ -344,9 +350,15 @@ hook.Add("PlayerDeath", "LootGoblin_PlayerDeath", function(victim, infl, attacke
timer.Create("LootGoblinWeaponDrop", 0.05, lootgoblin_weapons_dropped:GetInt(), function()
if #lootTable == 0 then -- Rebuild the loot table if we run out
for _, v in ipairs(weapons.GetList()) do
if v and not v.AutoSpawnable and v.CanBuy and #v.CanBuy > 0 and v.AllowDrop then
table.insert(lootTable, WEPS.GetClass(v))
end
if not v then continue end

-- Only allow weapons that can be bought, can be dropped, and don't spawn on their own
-- Specifically check AllowDrop for `false` because weapons in this list don't have the base table
-- applied and the base table has AllowDrop defaulting to `true`
if v.AutoSpawnable or v.AllowDrop == false then continue end
if not v.CanBuy or #v.CanBuy == 0 then continue end

table.insert(lootTable, WEPS.GetClass(v))
end
end

Expand Down
Loading