1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-07-13 00:51:46 +00:00

[Client] Fix crash caused by setting instant state for null localCast

This commit is contained in:
David Cernat 2019-11-28 20:28:55 +02:00
parent 5a46b40e1a
commit a385fcdd87

View file

@ -1195,6 +1195,10 @@ bool CharacterController::updateCreatureState()
localCast->spellId = spellid; localCast->spellId = spellid;
localCast->pressed = true; localCast->pressed = true;
localCast->shouldSend = true; localCast->shouldSend = true;
// Mark the attack as instant if there is no spellcast animation
if (!mAnimation->hasAnimation("spellcast"))
localCast->instant = true;
} }
/* /*
End of tes3mp addition End of tes3mp addition
@ -1203,17 +1207,6 @@ bool CharacterController::updateCreatureState()
MWMechanics::CastSpell cast(mPtr, nullptr, false, mCastingManualSpell); MWMechanics::CastSpell cast(mPtr, nullptr, false, mCastingManualSpell);
cast.playSpellCastingEffects(spellid, false); cast.playSpellCastingEffects(spellid, false);
/*
Start of tes3mp addition
Mark the attack as instant if there is no spellcast animation
*/
if (!mAnimation->hasAnimation("spellcast"))
localCast->instant = true;
/*
End of tes3mp addition
*/
if (!mAnimation->hasAnimation("spellcast")) if (!mAnimation->hasAnimation("spellcast"))
{ {
MWBase::Environment::get().getWorld()->castSpell(mPtr, mCastingManualSpell); // No "release" text key to use, so cast immediately MWBase::Environment::get().getWorld()->castSpell(mPtr, mCastingManualSpell); // No "release" text key to use, so cast immediately