Permalink
Browse files

TTT: fix thrown knife sometimes dealing double damage

A knife thrown from short range should not kill unless the target is
<50hp. Bug was causing the knife to hit the target twice, killing them
and still dropping the knife for reuse.

Seems likely that this was introduced due to some sort of physics
fix/change elsewhere, because I'm pretty sure this didn't happen way
back when I implemented the knife.
  • Loading branch information...
1 parent ee1dd98 commit 8ac11a6d1941a0a713b7ca6a226a3c247e24216e @svdm svdm committed Oct 27, 2013
@@ -66,6 +66,11 @@ function ENT:HitPlayer(other, tr)
self:BecomeWeaponDelayed()
end
end
+
+ -- As a thrown knife, after we hit a target we can never hit one again.
+ -- If we are picked up and re-thrown, a new knife_proj entity is created.
+ -- To make sure we can never deal damage twice, make HitPlayer do nothing.
+ self.HitPlayer = util.noop
end
function ENT:KillPlayer(other, tr)
@@ -39,7 +39,7 @@ GM.CRCs = {
["gamemode/radar.lua"] = "2065146432",
["gamemode/scoring.lua"] = "1754869329",
["gamemode/scoring_shd.lua"] = "4152282892",
- ["gamemode/shared.lua"] = "943316870",
+ ["gamemode/shared.lua"] = "4105872591",
["gamemode/tags.lua"] = "864385761",
["gamemode/traitor_state.lua"] = "910131773",
["gamemode/util.lua"] = "2325186707",
@@ -76,7 +76,7 @@ GM.CRCs = {
["entities/entities/ttt_game_text/init.lua"] = "362196437",
["entities/entities/ttt_hat_deerstalker/shared.lua"] = "1071834879",
["entities/entities/ttt_health_station/shared.lua"] = "3357240716",
- ["entities/entities/ttt_knife_proj/shared.lua"] = "4066454216",
+ ["entities/entities/ttt_knife_proj/shared.lua"] = "2987931244",
["entities/entities/ttt_logic_role/init.lua"] = "534956636",
["entities/entities/ttt_map_settings/init.lua"] = "2296862686",
["entities/entities/ttt_physhammer/shared.lua"] = "2823571999",
@@ -3,7 +3,7 @@ GM.Author = "Bad King Urgrain"
GM.Email = "thegreenbunny@gmail.com"
GM.Website = "ttt.badking.net"
-- Date of latest changes (YYYY-MM-DD)
-GM.Version = "2013-09-22"
+GM.Version = "2013-10-27"
GM.Customized = false

0 comments on commit 8ac11a6

Please sign in to comment.