Remove grapple if player changes class after throwing (#740)
* Remove hook if player has changed... ...their class after firing the hook. * Make grapple don't return to... ...player inventory and improve message. * Update ranged.lua Co-authored-by: LoneWolfHT <lonewolf04361@gmail.com>
This commit is contained in:
parent
870add029d
commit
a412c02e20
1 changed files with 9 additions and 0 deletions
|
@ -85,5 +85,14 @@ minetest.registered_entities["shooter_hook:hook"].on_step = function(self, dtime
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Remove hook if player changes class after throwing it
|
||||||
|
if not ctf_classes.get(self.user).properties.allow_grapples then
|
||||||
|
minetest.chat_send_player(self.user,
|
||||||
|
"Grapples don't work if you change class!")
|
||||||
|
self.object:remove()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
return old_grapple_step(self, dtime, ...)
|
return old_grapple_step(self, dtime, ...)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue