ULTIMA8: Avoid potential null reference

This commit is contained in:
Matthew Duggan 2021-05-10 14:50:36 +09:00
parent 927e7ca3b0
commit f456e268ec

View File

@ -69,7 +69,8 @@ bool DamageInfo::applyToItem(Item *item, uint16 points) const {
if (_sound) {
AudioProcess *audio = AudioProcess::get_instance();
if (audio) {
audio->playSFX(_sound, 0x10, item->getObjId(), 1, true);
ObjId objid = item ? item->getObjId() : 0;
audio->playSFX(_sound, 0x10, objid, 1, true);
}
}
if (replaceItem()) {