From 78c912fb4007c3e5f0b43de02646772acb21ecf2 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 9 Mar 2012 21:30:42 +0100 Subject: 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 --- src/game-server/character.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game-server/character.cpp') diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index 14b49bca..bf16e268 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -85,7 +85,8 @@ Character::Character(MessageIn &msg): mUpdateLevelProgress(false), mRecalculateLevel(true), mParty(0), - mTransaction(TRANS_NONE) + mTransaction(TRANS_NONE), + mNpcThread(0) { const AttributeManager::AttributeScope &attr = attributeManager->getAttributeScope(CharacterScope); @@ -111,6 +112,11 @@ Character::Character(MessageIn &msg): giveSpecial(3); } +Character::~Character() +{ + delete mNpcThread; +} + void Character::update() { // First, deal with being generic updates -- cgit v1.2.3-60-g2f50