Skip to content

Commit

Permalink
Fix drop bug
Browse files Browse the repository at this point in the history
Fixed a bug where dead players would pick up their own dropped rupees.
Adjusted collecting radius.

Original release date: 21 December 2017
  • Loading branch information
LeoLuxo authored Apr 27, 2020
1 parent 1449ad2 commit 3111638
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lua/entities/blue_rupee/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ENT:Think()
for i, p in pairs( players ) do
d = math.Distance( p:GetPos().x, p:GetPos().y, self:GetPos().x, self:GetPos().y )

if ( d <= p:BoundingRadius() and self:GetPos().z + 32 >= p:GetPos().z and self:GetPos().z - 32 <= p:OBBMaxs().z ) then
if ( d <= p:BoundingRadius() and self:GetPos().z + 12 >= p:GetPos().z and self:GetPos().z <= p:OBBMaxs().z and p:Alive() ) then
p:SetHealth( p:Health() + 5 )
self:EmitSound( "rupee2.wav", 150, 100, 1, CHAN_AUTO )
self:Remove()
Expand Down
2 changes: 1 addition & 1 deletion lua/entities/gold_rupee/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ENT:Think()
for i, p in pairs( players ) do
d = math.Distance( p:GetPos().x, p:GetPos().y, self:GetPos().x, self:GetPos().y )

if ( d <= p:BoundingRadius() and self:GetPos().z + 32 >= p:GetPos().z and self:GetPos().z - 32 <= p:OBBMaxs().z ) then
if ( d <= p:BoundingRadius() and self:GetPos().z + 12 >= p:GetPos().z and self:GetPos().z <= p:OBBMaxs().z and p:Alive() ) then
p:SetHealth( p:Health() + 300 )
self:EmitSound( "rupee3.wav", 150, 100, 1, CHAN_AUTO )
self:Remove()
Expand Down
2 changes: 1 addition & 1 deletion lua/entities/green_rupee/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ENT:Think()
for i, p in pairs( players ) do
d = math.Distance( p:GetPos().x, p:GetPos().y, self:GetPos().x, self:GetPos().y )

if ( d <= p:BoundingRadius() and self:GetPos().z + 32 >= p:GetPos().z and self:GetPos().z - 32 <= p:OBBMaxs().z ) then
if ( d <= p:BoundingRadius() and self:GetPos().z + 12 >= p:GetPos().z and self:GetPos().z <= p:OBBMaxs().z and p:Alive() ) then
p:SetHealth( p:Health() + 1 )
self:EmitSound( "rupee1.wav", 150, 100, 1, CHAN_AUTO )
self:Remove()
Expand Down
2 changes: 1 addition & 1 deletion lua/entities/red_rupee/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ENT:Think()
for i, p in pairs( players ) do
d = math.Distance( p:GetPos().x, p:GetPos().y, self:GetPos().x, self:GetPos().y )

if ( d <= p:BoundingRadius() and self:GetPos().z + 32 >= p:GetPos().z and self:GetPos().z - 32 <= p:OBBMaxs().z ) then
if ( d <= p:BoundingRadius() and self:GetPos().z + 12 >= p:GetPos().z and self:GetPos().z <= p:OBBMaxs().z and p:Alive() ) then
p:SetHealth( p:Health() + 20 )
self:EmitSound( "rupee2.wav", 150, 100, 1, CHAN_AUTO )
self:Remove()
Expand Down
2 changes: 1 addition & 1 deletion lua/entities/silver_rupee/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ENT:Think()
for i, p in pairs( players ) do
d = math.Distance( p:GetPos().x, p:GetPos().y, self:GetPos().x, self:GetPos().y )

if ( d <= p:BoundingRadius() and self:GetPos().z + 32 >= p:GetPos().z and self:GetPos().z - 32 <= p:OBBMaxs().z ) then
if ( d <= p:BoundingRadius() and self:GetPos().z + 12 >= p:GetPos().z and self:GetPos().z <= p:OBBMaxs().z and p:Alive() ) then
p:SetHealth( p:Health() + 100 )
self:EmitSound( "rupee3.wav", 150, 100, 1, CHAN_AUTO )
self:Remove()
Expand Down

0 comments on commit 3111638

Please sign in to comment.