3131#include " PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
3232
3333#include " Common/GameAudio.h"
34+ #include " Common/GameUtility.h"
3435#include " Common/GlobalData.h"
3536#include " Common/INI.h"
3637#include " Common/Player.h"
@@ -550,7 +551,8 @@ void SpecialPowerModule::aboutToDoSpecialPower( const Coord3D *location )
550551 // Let EVA do her thing
551552 SpecialPowerType type = getSpecialPowerModuleData ()->m_specialPowerTemplate ->getSpecialPowerType ();
552553
553- Player *localPlayer = ThePlayerList->getLocalPlayer ();
554+ Player *localPlayer = rts::getObservedOrLocalPlayer ();
555+ Relationship relationship = localPlayer->getRelationship (getObject ()->getTeam ());
554556
555557 // Only play the EVA sounds if this is not the local player, and the local player doesn't consider the
556558 // person an enemy.
@@ -564,7 +566,7 @@ void SpecialPowerModule::aboutToDoSpecialPower( const Coord3D *location )
564566 {
565567 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Own_ParticleCannon);
566568 }
567- else if ( localPlayer-> getRelationship ( getObject ()-> getTeam ()) != ENEMIES )
569+ else if (relationship != ENEMIES)
568570 {
569571 // Note: counting relationship NEUTRAL as ally. Not sure if this makes a difference???
570572 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Ally_ParticleCannon);
@@ -580,7 +582,7 @@ void SpecialPowerModule::aboutToDoSpecialPower( const Coord3D *location )
580582 {
581583 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Own_Nuke);
582584 }
583- else if ( localPlayer-> getRelationship ( getObject ()-> getTeam ()) != ENEMIES )
585+ else if (relationship != ENEMIES)
584586 {
585587 // Note: counting relationship NEUTRAL as ally. Not sure if this makes a difference???
586588 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Ally_Nuke);
@@ -596,7 +598,7 @@ void SpecialPowerModule::aboutToDoSpecialPower( const Coord3D *location )
596598 {
597599 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Own_ScudStorm);
598600 }
599- else if ( localPlayer-> getRelationship ( getObject ()-> getTeam ()) != ENEMIES )
601+ else if (relationship != ENEMIES)
600602 {
601603 // Note: counting relationship NEUTRAL as ally. Not sure if this makes a difference???
602604 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Ally_ScudStorm);
@@ -614,7 +616,7 @@ void SpecialPowerModule::aboutToDoSpecialPower( const Coord3D *location )
614616 {
615617 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Own_GPS_Scrambler);
616618 }
617- else if ( localPlayer-> getRelationship ( getObject ()-> getTeam ()) != ENEMIES )
619+ else if (relationship != ENEMIES)
618620 {
619621 // Note: counting relationship NEUTRAL as ally. Not sure if this makes a difference???
620622 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Ally_GPS_Scrambler);
@@ -630,7 +632,7 @@ void SpecialPowerModule::aboutToDoSpecialPower( const Coord3D *location )
630632 {
631633 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Own_Sneak_Attack);
632634 }
633- else if ( localPlayer-> getRelationship ( getObject ()-> getTeam ()) != ENEMIES )
635+ else if (relationship != ENEMIES)
634636 {
635637 // Note: counting relationship NEUTRAL as ally. Not sure if this makes a difference???
636638 TheEva->setShouldPlay (EVA_SuperweaponLaunched_Ally_Sneak_Attack);
0 commit comments