Fix crash when using chat commands affect/removeaffects
* related to pull request https://github.com/Bremaweb/adventuretest/pull/38 * related to pull request https://codeberg.org/minenux/minetest-game-adventuretest/pulls/38 * related to pull request https://git.minetest.io/minenux/minetest-game-adventuretest/pulls/38
This commit is contained in:
parent
c55a8f8dcd
commit
b2feac105a
@ -5,7 +5,9 @@ minetest.register_chatcommand("affect",{
|
||||
privs = {affects=true},
|
||||
func = function (name, param)
|
||||
local aname, affectid = string.match(param, "([^ ]+) (.+)")
|
||||
if ( affects.affectPlayer(aname,affectid) ) then
|
||||
if ( aname == nil or aname == "" or affectid == nil or affectid == '' ) then
|
||||
minetest.chat_send_player(name, "Syntax: affect <name> <affectid>")
|
||||
elseif ( affects.affectPlayer(aname,affectid) ) then
|
||||
minetest.chat_send_player(name,aname.." has been affected by "..affects._affects[affectid].name)
|
||||
else
|
||||
minetest.chat_send_player(name,"Unable to affect "..aname.." with "..affectid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user