1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 18:32:44 +01:00

Add check character for player

This commit is contained in:
Filip Gawin 2017-10-29 00:17:45 +02:00
parent edcd918f72
commit de77efe225

View File

@ -37,6 +37,7 @@ GameObject* ScriptArguments::getPlayerCharacter(unsigned int player) const {
auto playerId = parameters->at(player).integerValue();
PlayerController* controller = getWorld()->players.at(playerId);
RW_CHECK(controller != nullptr, "No controller for player " << player);
RW_CHECK(controller->getCharacter(), "No character for player " << player);
return controller->getCharacter();
}