summaryrefslogtreecommitdiff
path: root/src/net/tmwa/adminhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/adminhandler.cpp')
-rw-r--r--src/net/tmwa/adminhandler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index c75ec217..e2c3c74b 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -69,9 +69,12 @@ void AdminHandler::handleMessage(Net::MessageIn &msg)
case SMSG_ADMIN_IP:
id = msg.readInt32();
int ip = msg.readInt32();
- Player *player = (Player *)beingManager->findBeing(id);
- player->setIp(ip);
- player->updateName();
+ Being *being = beingManager->findBeing(id);
+ if (Player *player = dynamic_cast<Player *>(being))
+ {
+ player->setIp(ip);
+ player->updateName();
+ }
break;
}
}