[b43] canProject fix

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

[b43] canProject fix

#1 Post by tiger_eye »

The patch below (and attached) fixes a long-standing problem in the function "canProject". Uh, don't ask how this can currently be exploited :-P

Code: Select all

diff --git a/game/engines/default/engine/interface/ActorProject.lua b/game/engines/default/engine/interface/ActorProject.lua
index f1b7797..e7d7e8f 100644
--- a/game/engines/default/engine/interface/ActorProject.lua
+++ b/game/engines/default/engine/interface/ActorProject.lua
@@ -268,8 +268,8 @@ function _M:canProject(t, x, y)
                return
        end
 
-       if stop_x == x and stop_y == y then return true, stop_x, stop_y, stop_x, stop_y end
-       return false, stop_x, stop_y, stop_radius_x, stop_radius_y
+       local is_hit = stop_x == x and stop_y == y
+       return is_hit, stop_x, stop_y, stop_radius_x, stop_radius_y
 end
 
 --- Project damage to a distance using a moving projectile
Attachments
canProject_fix.txt
(668 Bytes) Downloaded 89 times
darkgod wrote:OMFG tiger eye you are my hero!

Post Reply