| 198 | } |
| 199 | |
| 200 | GameValue ObjSetIdentity(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 201 | { |
| 202 | Object* obj = GetObject(oper1); |
| 203 | if (!obj) |
| 204 | { |
| 205 | return NOTHING; |
| 206 | } |
| 207 | |
| 208 | VehicleWithBrain* person = dyn_cast<VehicleWithBrain>(obj); |
| 209 | if (!person) |
| 210 | { |
| 211 | return NOTHING; |
| 212 | } |
| 213 | |
| 214 | GameStringType name = oper2; |
| 215 | const ParamEntry* entry = FindIdentity(name); |
| 216 | if (entry) |
| 217 | { |
| 218 | AIUnitInfo& info = person->GetInfo(); |
| 219 | info._identityContext = RString(); |
| 220 | info._name = DecodeLegacyTextToRString((*entry) >> "name", GLanguage); |
| 221 | info._face = (*entry) >> "face"; |
| 222 | info._glasses = (*entry) >> "glasses"; |
| 223 | info._speaker = (*entry) >> "speaker"; |
| 224 | info._pitch = (*entry) >> "pitch"; |
| 225 | |
| 226 | person->SetFace(info._face); |
| 227 | person->SetGlasses(info._glasses); |
| 228 | if (person->Brain()) |
| 229 | { |
| 230 | person->Brain()->SetSpeaker(info._speaker, info._pitch); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | return NOTHING; |
| 235 | } |
| 236 | |
| 237 | GameValue ObjSetFace(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 238 | { |
nothing calls this directly
no test coverage detected