Update StarUniverseServer.cpp
This commit is contained in:
parent
d53c3ae0e7
commit
d76d217901
@ -657,8 +657,9 @@ void UniverseServer::updateShips() {
|
|||||||
if (auto shipWorld = getWorld(ClientShipWorldId(p.second->playerUuid()))) {
|
if (auto shipWorld = getWorld(ClientShipWorldId(p.second->playerUuid()))) {
|
||||||
shipWorld->executeAction([&](WorldServerThread*, WorldServer* shipWorld) {
|
shipWorld->executeAction([&](WorldServerThread*, WorldServer* shipWorld) {
|
||||||
String species;
|
String species;
|
||||||
if (auto jSpecies = shipWorld->getProperty("ship.species").optString())
|
Json jSpecies = shipWorld->getProperty("ship.species");
|
||||||
species = *jSpecies;
|
if (jSpecies.isType(Json::Type::String))
|
||||||
|
species = jSpecies.toString();
|
||||||
else
|
else
|
||||||
shipWorld->setProperty("ship.species", species = p.second->playerSpecies());
|
shipWorld->setProperty("ship.species", species = p.second->playerSpecies());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user