1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-30 00:36:41 +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->pressed = 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
@ -1203,17 +1207,6 @@ bool CharacterController::updateCreatureState()
MWMechanics::CastSpell cast(mPtr, nullptr, false, mCastingManualSpell);
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"))
{
MWBase::Environment::get().getWorld()->castSpell(mPtr, mCastingManualSpell); // No "release" text key to use, so cast immediately