diff options
Diffstat (limited to 'src/netcomputer.cpp')
-rw-r--r-- | src/netcomputer.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/netcomputer.cpp b/src/netcomputer.cpp index 663d74a8..ff1c93a1 100644 --- a/src/netcomputer.cpp +++ b/src/netcomputer.cpp @@ -22,6 +22,7 @@ */ #include "netcomputer.h" +#include "state.h" #include <cstdlib> #include <iostream> @@ -55,5 +56,27 @@ void NetComputer::setAccount(tmwserv::Account *acc) void NetComputer::setCharacter(tmwserv::Being *ch) { + tmwserv::State &state = tmwserv::State::instance(); + if (character != NULL) + { + // Remove being from the world : This is buggy for now. + //state.removeBeing(character); + } character = ch; + state.addBeing(character, character->getMap()); } + +void NetComputer::unsetAccount() +{ + unsetCharacter(); + account = NULL; +} + +void NetComputer::unsetCharacter() +{ + // remove being from world + //tmwserv::State &state = tmwserv::State::instance(); + //state.removeBeing(character); + character = NULL; +} + |