diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-15 22:15:31 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-15 22:15:31 +0200 |
commit | c53bc90dbaa876a86f762a3d864b1f920e2b8071 (patch) | |
tree | 1a8174f4d1745a4799210db970aa2230df622d34 /scripts/lua/libmana.lua | |
parent | b89e404f85358f2e3ff87d7731376dbeacdf9778 (diff) | |
parent | 81be8dc99ba7558c8915310eed095df43e3bdbf7 (diff) | |
download | manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.tar.gz manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.tar.bz2 manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.tar.xz manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.zip |
Merge branch 'master' into lpc2012
Conflicts:
src/account-server/accounthandler.cpp
src/game-server/character.cpp
Diffstat (limited to 'scripts/lua/libmana.lua')
-rw-r--r-- | scripts/lua/libmana.lua | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/lua/libmana.lua b/scripts/lua/libmana.lua index b87de1fe..20a5e13f 100644 --- a/scripts/lua/libmana.lua +++ b/scripts/lua/libmana.lua @@ -326,7 +326,7 @@ function on_death(being, funct) ondeath_functs[being] = {} end table.insert(ondeath_functs[being], funct) - being_register(being) + being:register() end --- LUA on_remove (scheduling) @@ -340,7 +340,7 @@ function on_remove(being, funct) onremove_functs[being] = {} end table.insert(onremove_functs[being], funct) - being_register(being) + being:register() end -- Registered as callback for when a registered being dies. @@ -375,10 +375,8 @@ end -- **Warning:** Before reducing the money make sure to check if the character -- owns enough money using chr_money. chr_money_change = function(ch, amount) - being_set_base_attribute( - ch, - ATTR_GP, - being_get_base_attribute(ch, ATTR_GP) + amount) + ch:set_base_attribute(ATTR_GP, + ch:base_attribute(ATTR_GP) + amount) end --- LUA chr_money (inventory) @@ -389,7 +387,7 @@ end -- **Warning:** Before reducing the money make sure to check if the character -- owns enough money using chr_money. chr_money = function(ch) - return being_get_base_attribute(ch, ATTR_GP) + return ch:base_attribute(ATTR_GP) end -- Register callbacks @@ -400,4 +398,4 @@ on_create_npc_delayed(create_npc_delayed) on_map_initialize(map_initialize) on_being_death(death_notification) -on_being_remove(remove_notification) +on_entity_remove(remove_notification) |