Make sure to prevent to transition to curious if curious isn't enabled (moh 2.30 feature)

This commit is contained in:
smallmodel 2023-10-23 11:59:06 +02:00
parent cf61ae0332
commit e850dd1963
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -4951,7 +4951,8 @@ void Actor::HandlePain(Event *ev)
//FIXME: macro
SetCuriousAnimHint(7);
if (m_bEnableEnemy && m_ThinkStates[THINKLEVEL_IDLE] == THINKSTATE_IDLE) {
// m_bIsCurious check: Added in 2.30
if (m_bEnableEnemy && m_ThinkStates[THINKLEVEL_IDLE] == THINKSTATE_IDLE && m_bIsCurious) {
SetEnemyPos(attacker->origin);
m_pszDebugState = "from_pain";
SetThinkState(THINKSTATE_CURIOUS, THINKLEVEL_IDLE);
@ -8213,6 +8214,11 @@ Should actor transition think state to grenade ?
*/
bool Actor::PassesTransitionConditions_Grenade(void)
{
if (!m_bIsCurious) {
// Added in 2.30
return false;
}
if (m_bLockThinkState || !m_bEnableEnemy) {
return false;
}
@ -9848,6 +9854,7 @@ void Actor::Grenade_EventFire(Event *ev)
speed = dir.normalize();
if (g_protocol >= PROTOCOL_MOHTA_MIN) {
// Added in 2.30
switch (m_iNationality) {
case ACTOR_NATIONALITY_ITALIAN:
strGrenade = "models/projectiles/Bomba_ai.tik";