ASYLUM: check if object exists

On level 13, the game tries to set transparency of an object which doesn't exist (id 4562)
This commit is contained in:
alxpnv 2021-04-07 14:07:53 +03:00 committed by Eugene Sandulenko
parent cc41cfb459
commit fe40af0f44
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -1806,6 +1806,10 @@ IMPLEMENT_OPCODE(UpdateTransparency)
if (cmd->param2 >= 0 && cmd->param2 <= 3) {
if (cmd->param1) {
Object *object = getWorld()->getObjectById((ObjectId)cmd->param1);
if (!object) {
warning("No object with id %d", cmd->param1);
return;
}
if (!cmd->param2)
object->setTransparency(0);