mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 10:22:52 +01:00
Add check character for player
This commit is contained in:
parent
edcd918f72
commit
de77efe225
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user