diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 15:40:57 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 15:40:57 +0200 |
commit | ed8fba0a47d2e498267cbfbf1271bacb76c400e9 (patch) | |
tree | d9e2bec54c051edb9d6c4175c3e5e5532e8d35ce /scripts/lua | |
parent | 769030e6bd22faeb760731172c221ae801c04dcc (diff) | |
parent | f6f27a9ffaf72f9856240db1bb788a9efa3e86f0 (diff) | |
download | manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.gz manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.bz2 manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.xz manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.zip |
Merge branch 'master' into lpc2012
Diffstat (limited to 'scripts/lua')
-rw-r--r-- | scripts/lua/libmana.lua | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/lua/libmana.lua b/scripts/lua/libmana.lua index 20a5e13f..7393ce60 100644 --- a/scripts/lua/libmana.lua +++ b/scripts/lua/libmana.lua @@ -367,27 +367,27 @@ end -- Below are some convenience methods added to the engine API ---- LUA chr_money_change (inventory) --- chr_money_change(handle character, int amount) +--- LUA entity:change_money (inventory) +-- entity:change_money(int amount) --- --- Changes the money currently owned by ''character'' by ''amount''. +-- Valid only for character entities. +-- +-- Changes the money currently owned by this character by ''amount''. -- -- **Warning:** Before reducing the money make sure to check if the character --- owns enough money using chr_money. -chr_money_change = function(ch, amount) - ch:set_base_attribute(ATTR_GP, - ch:base_attribute(ATTR_GP) + amount) +-- owns enough money using entity:money. +function Entity:change_money(amount) + self:set_base_attribute(ATTR_GP, self:base_attribute(ATTR_GP) + amount) end ---- LUA chr_money (inventory) --- chr_money(handle character) +--- LUA entity:money (inventory) +-- entity:money() --- --- Changes the money currently owned by ''character'' by ''amount''. +-- Valid only for character entities. -- --- **Warning:** Before reducing the money make sure to check if the character --- owns enough money using chr_money. -chr_money = function(ch) - return ch:base_attribute(ATTR_GP) +-- Returns the money currently owned by this character. +function Entity:money() + return self:base_attribute(ATTR_GP) end -- Register callbacks |