diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-09 21:30:42 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-10 18:07:29 +0100 |
commit | 78c912fb4007c3e5f0b43de02646772acb21ecf2 (patch) | |
tree | e45409ff061de75b0e4273763a87f5a25de6a65b /example | |
parent | 2fa7d1f39b24714ee6dc72b6b9e61ec5a1997724 (diff) | |
download | manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.tar.gz manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.tar.bz2 manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.tar.xz manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.zip |
Moved the managing of NPC script coroutines into C++
Rather than wrapping NPC functions up in coroutines in the Lua side, they
are now managed on the C++ side as "script threads", which are essentially
the same thing.
The main purpose is that the server can now know whether any of these long
running script interactions are still active, which will probably be useful
when adding the ability to reload scripts.
Reviewed-by: Erik Schilling
Diffstat (limited to 'example')
-rw-r--r-- | example/scripts/npcs/banker.lua | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/example/scripts/npcs/banker.lua b/example/scripts/npcs/banker.lua index 4e048653..790f9a53 100644 --- a/example/scripts/npcs/banker.lua +++ b/example/scripts/npcs/banker.lua @@ -20,7 +20,6 @@ function Banker(npc, ch) end local account = tonumber(get_quest_var(ch, "BankAccount")) local result = -1 - do_wait() if (account == nil) then --Initial account creation, if needed do_message(npc, ch, "Hello! Would you like to setup a bank account? There is a sign-on bonus right now!") @@ -45,7 +44,6 @@ function Banker(npc, ch) if (money > 0) then --Make sure they have money to deposit do_message(npc, ch, "How much would you like to deposit? (0 will cancel)") input = do_ask_integer(npc, ch, 0, money, 1) - do_wait() money = mana.chr_money(ch) if (input > 0 and input <= money) then --Make sure something weird doesn't happen and they try to deposit more than they have mana.chr_money_change(ch, -input) |