mirror of https://github.com/AxioDL/metaforce.git
TCastToPtr adjustments
This commit is contained in:
parent
3cc93ffd75
commit
d1b55e23db
|
@ -164,11 +164,8 @@ class CStateManager
|
|||
void UpdateThermalVisor();
|
||||
|
||||
TUniqueId xf74_lastTrigger = kInvalidUniqueId;
|
||||
TUniqueId xf76_lastRelay = kInvalidUniqueId;
|
||||
public:
|
||||
/* TODO: Figure out what these are
|
||||
* Public for CScriptRelay
|
||||
*/
|
||||
TUniqueId xf76_ = kInvalidUniqueId;
|
||||
/* TODO: Public for CFirstPersonCamera */
|
||||
u32 x904_;
|
||||
|
||||
|
@ -310,8 +307,11 @@ public:
|
|||
CAiWaypointList& GetAiWaypointObjectList() const { return *x83c_aiWaypointObjs; }
|
||||
CPlatformAndDoorList& GetPlatformAndDoorObjectList() const { return *x844_platformAndDoorObjs; }
|
||||
std::pair<u32, u32> CalculateScanCompletionRate() const;
|
||||
void SetLastTrigger(TUniqueId uid) { xf74_lastTrigger = uid; }
|
||||
TUniqueId GetLastTrigger() const { return xf74_lastTrigger; }
|
||||
void SetLastTriggerId(TUniqueId uid) { xf74_lastTrigger = uid; }
|
||||
TUniqueId GetLastTriggerId() const { return xf74_lastTrigger; }
|
||||
void SetLastRelayId(TUniqueId uid) { xf76_lastRelay = uid; }
|
||||
TUniqueId* GetLastRelayIdPtr() { return &xf76_lastRelay; }
|
||||
TUniqueId GetLastRelayId() const { return xf76_lastRelay; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ set(COLLISION_SOURCES
|
|||
CMaterialList.hpp
|
||||
CMaterialFilter.hpp CMaterialFilter.cpp
|
||||
CInternalRayCastStructure.hpp CInternalRayCastStructure.cpp
|
||||
CRayCastResult.hpp CRayCastResult.cpp)
|
||||
CRayCastResult.hpp CRayCastResult.cpp
|
||||
CCollisionActor.hpp CCollisionActor.cpp)
|
||||
|
||||
runtime_add_list(Collision COLLISION_SOURCES)
|
||||
|
|
|
@ -40,7 +40,8 @@ CListeningAiList::CListeningAiList()
|
|||
|
||||
bool CListeningAiList::IsQualified(const CEntity& ent)
|
||||
{
|
||||
return TCastToConstPtr<CPatterned>(ent);
|
||||
TCastToConstPtr<CAi> ai(ent);
|
||||
return ai && ai->IsListening();
|
||||
}
|
||||
|
||||
CAiWaypointList::CAiWaypointList()
|
||||
|
|
|
@ -18,5 +18,10 @@ CBeetle::CBeetle(TUniqueId uid, const std::string& name, const CEntityInfo& info
|
|||
|
||||
}
|
||||
|
||||
void CBeetle::Accept(IVisitor &visitor)
|
||||
{
|
||||
visitor.Visit(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ public:
|
|||
const CPatternedInfo&, CPatterned::EFlavorType,EEntranceType, const CDamageInfo &, const CDamageVulnerability&,
|
||||
const zeus::CVector3f&, float, float, float, const CDamageVulnerability&, const CActorParameters&,
|
||||
const rstl::optional_object<CStaticRes>);
|
||||
|
||||
void Accept(IVisitor &visitor);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ set(MP1_SOURCES
|
|||
CWarWasp.hpp CWarWasp.cpp
|
||||
CSpacePirate.hpp CSpacePirate.cpp
|
||||
CBabygoth.hpp CBabygoth.cpp
|
||||
CMetroidPrimeRelay.hpp CMetroidPrimeRelay.cpp
|
||||
CSaveUI.hpp CSaveUI.cpp
|
||||
CMemoryCardDriver.hpp CMemoryCardDriver.cpp
|
||||
CQuitScreen.hpp CQuitScreen.cpp
|
||||
|
|
|
@ -16,5 +16,10 @@ CNewIntroBoss::CNewIntroBoss(TUniqueId uid, const std::string& name, const CEnti
|
|||
{
|
||||
}
|
||||
|
||||
void CNewIntroBoss::Accept(IVisitor &visitor)
|
||||
{
|
||||
visitor.Visit(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@ public:
|
|||
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
|
||||
const CActorParameters& actParms, float, u32, const CDamageInfo& dInfo,
|
||||
u32, u32, u32, u32);
|
||||
|
||||
void Accept(IVisitor &visitor);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,5 +14,10 @@ CSpacePirate::CSpacePirate(TUniqueId uid, const std::string& name, const CEntity
|
|||
{
|
||||
}
|
||||
|
||||
void CSpacePirate::Accept(IVisitor &visitor)
|
||||
{
|
||||
visitor.Visit(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@ class CSpacePirate : public CPatterned
|
|||
public:
|
||||
CSpacePirate(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
|
||||
const CActorParameters&, const CPatternedInfo&, CInputStream&, u32);
|
||||
|
||||
void Accept(IVisitor &visitor);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,12 +10,11 @@ CWarWasp::CWarWasp(TUniqueId uid, const std::string& name, const CEntityInfo& in
|
|||
CModelData&& mData, const CPatternedInfo& pInfo, CPatterned::EFlavorType flavor,
|
||||
CPatterned::EColliderType collider, const CDamageInfo& dInfo1, const CActorParameters& actorParms,
|
||||
ResId weapon, const CDamageInfo& dInfo2, ResId particle, u32 w3)
|
||||
: CPatterned(EUnknown::ThirtyNine, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer,
|
||||
collider, EBodyType::Three, actorParms, false)
|
||||
: CPatterned(EUnknown::ThirtyNine, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, collider,
|
||||
EBodyType::Three, actorParms, false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CWarWasp::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@ public:
|
|||
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
|
||||
CPatterned::EFlavorType flavor, CPatterned::EColliderType, const CDamageInfo& dInfo1, const CActorParameters&,
|
||||
ResId weapon, const CDamageInfo& dInfo2, ResId particle, u32 w3);
|
||||
|
||||
void Accept(IVisitor &visitor);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,60 +8,66 @@ class EndNamespace:
|
|||
pass
|
||||
|
||||
CENTITY_TYPES = (
|
||||
# Class, Visit, Header
|
||||
('CActor', 'World/CActor.hpp'),
|
||||
('CPhysicsActor', 'World/CPhysicsActor.hpp'),
|
||||
('CGameCamera', 'Camera/CGameCamera.hpp'),
|
||||
('CPatterned', 'World/CPatterned.hpp'),
|
||||
('CGameLight', 'World/CGameLight.hpp'),
|
||||
('CAi', 'World/CAi.hpp'),
|
||||
('CBallCamera', 'Camera/CBallCamera.hpp'),
|
||||
('CBomb', 'Weapon/CBomb.hpp'),
|
||||
('CCinematicCamera', 'Camera/CCinematicCamera.hpp'),
|
||||
('CScriptHUDMemo', 'World/CScriptHUDMemo.hpp'),
|
||||
('CCollisionActor', 'Collision/CCollisionActor.hpp'),
|
||||
('CDestroyableRock', 'World/CDestroyableRock.hpp'),
|
||||
('CEnergyProjectile', 'Weapon/CEnergyProjectile.hpp'),
|
||||
('CEntity', 'World/CEntity.hpp'),
|
||||
('CExplosion', 'Weapon/CExplosion.hpp'),
|
||||
('CFirstPersonCamera', 'Camera/CFirstPersonCamera.hpp'),
|
||||
('CFishCloud', 'World/CFishCloud.hpp'),
|
||||
('CGameCamera', 'Camera/CGameCamera.hpp'),
|
||||
('CGameLight', 'World/CGameLight.hpp'),
|
||||
('CGameProjectile', 'Weapon/CGameProjectile.hpp'),
|
||||
('CHUDBillboardEffect', 'World/CHUDBillboardEffect.hpp'),
|
||||
Namespace('MP1'),
|
||||
('CMetroidPrimeRelay', 'MP1/CMetroidPrimeRelay.hpp', 'MP1'),
|
||||
EndNamespace(),
|
||||
('CPathCamera', 'Camera/CPathCamera.hpp'),
|
||||
('CAi', 'World/CAi.hpp'),
|
||||
('CPhysicsActor', 'World/CPhysicsActor.hpp'),
|
||||
('CPlayer', 'World/CPhysicsActor.hpp'),
|
||||
('CRepulsor', 'World/CRepulsor.hpp'),
|
||||
('CScriptActor', 'World/CScriptActor.hpp'),
|
||||
('CScriptActorKeyframe', 'World/CScriptActorKeyframe.hpp'),
|
||||
('CScriptAiJumpPoint', 'World/CScriptAiJumpPoint.hpp'),
|
||||
('CScriptCameraHint', 'World/CScriptCameraHint.hpp'),
|
||||
('CScriptPickup', 'World/CScriptPickup.hpp'),
|
||||
('CScriptRandomRelay', 'World/CScriptRandomRelay.hpp'),
|
||||
('CScriptMemoryRelay', 'World/CScriptMemoryRelay.hpp'),
|
||||
('CScriptRelay', 'World/CScriptRelay.hpp'),
|
||||
('CScriptCameraPitchVolume', 'World/CScriptCameraPitchVolume.hpp'),
|
||||
('CScriptCameraWaypoint', 'World/CScriptCameraWaypoint.hpp'),
|
||||
('CScriptCoverPoint', 'World/CScriptCoverPoint.hpp'),
|
||||
('CScriptSpawnPoint', 'World/CScriptSpawnPoint.hpp'),
|
||||
('CRepulsor', 'World/CRepulsor.hpp'),
|
||||
('CScriptCameraHintTrigger', 'World/CScriptCameraHintTrigger.hpp'),
|
||||
('CScriptSwitch', 'World/CScriptSwitch.hpp'),
|
||||
('CScriptAiJumpPoint', 'World/CScriptAiJumpPoint.hpp'),
|
||||
('CScriptColorModulate', 'World/CScriptColorModulate.hpp'),
|
||||
('CScriptCameraPitchVolume', 'World/CScriptCameraPitchVolume.hpp'),
|
||||
('CPlayer', 'World/CPlayer.hpp'),
|
||||
('CScriptActor', 'World/CScriptActor.hpp'),
|
||||
('CScriptWaypoint', 'World/CScriptWaypoint.hpp'),
|
||||
('CScriptDoor', 'World/CScriptDoor.hpp'),
|
||||
('CScriptActorKeyframe', 'World/CScriptActorKeyframe.hpp'),
|
||||
('CScriptTrigger', 'World/CScriptTrigger.hpp'),
|
||||
('CScriptSound', 'World/CScriptSound.hpp'),
|
||||
('CWeapon', 'Weapon/CWeapon.hpp'),
|
||||
('CGameProjectile', 'Weapon/CGameProjectile.hpp'),
|
||||
('CBeamProjectile', 'Weapon/CBeamProjectile.hpp'),
|
||||
('CPlasmaProjectile', 'Weapon/CPlasmaProjectile.hpp'),
|
||||
('CScriptCounter', 'World/CScriptCounter.hpp'),
|
||||
('CScriptBeam', 'World/CScriptBeam.hpp'),
|
||||
('CScriptStreamedMusic', 'World/CScriptStreamedMusic.hpp'),
|
||||
('CScriptTimer', 'World/CScriptTimer.hpp'),
|
||||
('CScriptEffect', 'World/CScriptEffect.hpp'),
|
||||
('CScriptPlatform', 'World/CScriptPlatform.hpp'),
|
||||
('CScriptGrapplePoint', 'World/CScriptGrapplePoint.hpp'),
|
||||
('CScriptGenerator', 'World/CScriptGenerator.hpp'),
|
||||
('CScriptShadowProjector', 'World/CScriptShadowProjector.hpp'),
|
||||
('CScriptDock', 'World/CScriptDock.hpp'),
|
||||
('CScriptAreaAttributes', 'World/CScriptAreaAttributes.hpp'),
|
||||
('CScriptPickupGenerator', 'World/CScriptPickupGenerator.hpp'),
|
||||
('CScriptPointOfInterest', 'World/CScriptPointOfInterest.hpp'),
|
||||
('CScriptCameraFilterKeyframe', 'World/CScriptCameraFilterKeyframe.hpp'),
|
||||
('CScriptCameraBlurKeyframe', 'World/CScriptCameraBlurKeyframe.hpp'),
|
||||
('CScriptActorRotate', 'World/CScriptActorRotate.hpp'),
|
||||
('CScriptDebugCameraWaypoint', 'World/CScriptDebugCameraWaypoint.hpp'),
|
||||
('CScriptDistanceFog', 'World/CScriptDistanceFog.hpp'),
|
||||
('CScriptDamageableTrigger', 'World/CScriptDamageableTrigger.hpp'),
|
||||
('CScriptDockAreaChange', 'World/CScriptDockAreaChange.hpp'),
|
||||
('CScriptDock', 'World/CScriptDock.hpp'),
|
||||
('CScriptDoor', 'World/CScriptDoor.hpp'),
|
||||
('CScriptEffect', 'World/CScriptEffect.hpp'),
|
||||
('CScriptGrapplePoint', 'World/CScriptGrapplePoint.hpp'),
|
||||
('CScriptGunTurret', 'World/CScriptGunTurret.hpp'),
|
||||
('CScriptMazeNode', 'World/CScriptMazeNode.hpp'),
|
||||
('CScriptPickup', 'World/CScriptPickup.hpp'),
|
||||
('CScriptPlatform', 'World/CScriptPlatform.hpp'),
|
||||
('CScriptPlayerHint', 'World/CScriptPlayerHint.hpp'),
|
||||
('CScriptPointOfInterest', 'World/CScriptPointOfInterest.hpp'),
|
||||
('CScriptRoomAcoustics', 'World/CScriptRoomAcoustics.hpp'),
|
||||
('CScriptSound', 'World/CScriptSound.hpp'),
|
||||
('CScriptSpawnPoint', 'World/CScriptSpawnPoint.hpp'),
|
||||
('CScriptSpecialFunction', 'World/CScriptSpecialFunction.hpp'),
|
||||
('CScriptDebris', 'World/CScriptDebris.hpp'),
|
||||
('CScriptSpiderBallAttractionSurface', 'World/CScriptSpiderBallAttractionSurface.hpp'),
|
||||
('CScriptSpiderBallWaypoint', 'World/CScriptSpiderBallWaypoint.hpp'),
|
||||
('CScriptTargetingPoint', 'World/CScriptTargetingPoint.hpp'),
|
||||
('CTeamAiMgr', 'World/CTeamAiMgr.hpp'),
|
||||
('CScriptTimer', 'World/CScriptTimer.hpp'),
|
||||
('CScriptTrigger', 'World/CScriptTrigger.hpp'),
|
||||
('CScriptVisorFlare', 'World/CScriptVisorFlare.hpp'),
|
||||
('CScriptWater', 'World/CScriptWater.hpp'),
|
||||
('CScriptWaypoint', 'World/CScriptWaypoint.hpp'),
|
||||
('CSnakeWeedSwarm', 'World/CSnakeWeedSwarm.hpp'),
|
||||
('CScriptSpindleCamera', 'World/CScriptSpindleCamera.hpp'),
|
||||
('CWallCrawlerSwarm', 'World/CWallCrawlerSwarm.hpp'),
|
||||
('CWeapon', 'Weapon/CWeapon.hpp'),
|
||||
)
|
||||
|
||||
def getqualified(tp):
|
||||
|
|
|
@ -21,6 +21,10 @@ set(WEAPON_SOURCES
|
|||
CGameProjectile.hpp CGameProjectile.cpp
|
||||
CBeamProjectile.hpp CBeamProjectile.cpp
|
||||
CBeamInfo.hpp CBeamInfo.cpp
|
||||
CPlasmaProjectile.hpp CPlasmaProjectile.cpp)
|
||||
CPlasmaProjectile.hpp CPlasmaProjectile.cpp
|
||||
CEnergyProjectile.cpp CEnergyProjectile.cpp
|
||||
CExplosion.hpp CExplosion.cpp
|
||||
CBomb.hpp CBomb.cpp
|
||||
CPowerBomb.hpp CPowerBomb.cpp)
|
||||
|
||||
runtime_add_list(Weapon WEAPON_SOURCES)
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
virtual CDamageVulnerability GetDamageVulnerability() { return x260_damageVulnerability; }
|
||||
virtual void TakeDamage(const zeus::CVector3f&, float) {}
|
||||
virtual bool CanBeShot(const CStateManager&, int) { return true; }
|
||||
virtual bool IsListening() { return false; }
|
||||
virtual bool IsListening() const { return false; }
|
||||
virtual int Listen(const zeus::CVector3f&, EListenNoiseType) { return 0; }
|
||||
|
||||
virtual void Patrol(CStateManager&, EStateMsg, float) {}
|
||||
|
|
|
@ -45,6 +45,8 @@ set(WORLD_SOURCES
|
|||
CScriptPickupGenerator.hpp CScriptPickupGenerator.cpp
|
||||
CScriptPointOfInterest.hpp CScriptPointOfInterest.cpp
|
||||
CScriptAreaAttributes.hpp CScriptAreaAttributes.cpp
|
||||
CFishCloud.hpp CFishCloud.cpp
|
||||
CScriptVisorFlare.hpp CScriptVisorFlare.cpp
|
||||
CScriptCameraWaypoint.hpp CScriptCameraWaypoint.cpp
|
||||
CScriptCoverPoint.hpp CScriptCoverPoint.cpp
|
||||
CScriptSpawnPoint.hpp CScriptSpawnPoint.cpp
|
||||
|
@ -58,17 +60,25 @@ set(WORLD_SOURCES
|
|||
CScriptCameraBlurKeyframe.hpp CScriptCameraBlurKeyframe.cpp
|
||||
CScriptDamageableTrigger.hpp CScriptDamageableTrigger.cpp
|
||||
CScriptDebris.hpp CScriptDebris.cpp
|
||||
CScriptDebugCameraWaypoint.hpp CScriptDebugCameraWaypoint.cpp
|
||||
CScriptDistanceFog.hpp CScriptDistanceFog.cpp
|
||||
CScriptDockAreaChange.hpp CScriptDockAreaChange.cpp
|
||||
CScriptActorRotate.hpp CScriptActorRotate.cpp
|
||||
CScriptSpecialFunction.hpp CScriptSpecialFunction.cpp
|
||||
CScriptPlayerHint.hpp CScriptPlayerHint.cpp
|
||||
CScriptTargetingPoint.hpp CScriptTargetingPoint.cpp
|
||||
CScriptPlayerActor.hpp CScriptPlayerActor.cpp
|
||||
CScriptSwitch.hpp CScriptSwitch.cpp
|
||||
CScriptAiJumpPoint.hpp CScriptAiJumpPoint.cpp
|
||||
CScriptRoomAcoustics.hpp CScriptRoomAcoustics.cpp
|
||||
CScriptColorModulate.hpp CScriptColorModulate.cpp
|
||||
CScriptStreamedMusic.hpp CScriptStreamedMusic.cpp
|
||||
CRepulsor.hpp CRepulsor.cpp
|
||||
CScriptGunTurret.hpp CScriptGunTurret.cpp
|
||||
CScriptCameraPitchVolume.hpp CScriptCameraPitchVolume.cpp
|
||||
CTeamAiMgr.hpp CTeamAiMgr.cpp
|
||||
CSnakeWeedSwarm.hpp CSnakeWeedSwarm.cpp
|
||||
CScriptSpindleCamera.hpp CScriptSpindleCamera.cpp
|
||||
CScriptCameraHintTrigger.hpp CScriptCameraHintTrigger.cpp
|
||||
CScriptBeam.hpp CScriptBeam.cpp
|
||||
CScriptMazeNode.hpp CScriptMazeNode.cpp
|
||||
|
@ -94,6 +104,8 @@ set(WORLD_SOURCES
|
|||
CFluidPlaneCPU.hpp CFluidPlaneCPU.cpp
|
||||
CFluidPlaneDoor.hpp CFluidPlaneDoor.cpp
|
||||
CRippleManager.hpp CRippleManager.cpp
|
||||
CRipple.hpp CRipple.cpp)
|
||||
CRipple.hpp CRipple.cpp
|
||||
CDestroyableRock.hpp CDestroyableRock.cpp
|
||||
CHUDBillboardEffect.hpp CHUDBillboardEffect.cpp)
|
||||
|
||||
runtime_add_list(World WORLD_SOURCES)
|
||||
|
|
|
@ -25,9 +25,4 @@ CPatterned::CPatterned(EUnknown, TUniqueId uid, const std::string& name, CPatter
|
|||
{
|
||||
}
|
||||
|
||||
void CPatterned::Accept(IVisitor& visitor)
|
||||
{
|
||||
visitor.Visit(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
CPatterned::EMovementType movement, EColliderType collider, EBodyType body,
|
||||
const CActorParameters& params, bool b1);
|
||||
|
||||
void Accept(IVisitor& visitor);
|
||||
virtual void Death(const zeus::CVector3f&, CStateManager&) {}
|
||||
virtual void KnockBack(const zeus::CVector3f&, CStateManager&) {}
|
||||
};
|
||||
|
|
|
@ -27,14 +27,14 @@ void CScriptRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CS
|
|||
if (x30_24_active)
|
||||
return;
|
||||
|
||||
x38_++;
|
||||
TUniqueId tmp = stateMgr.xf76_;
|
||||
x38_refCount++;
|
||||
TUniqueId tmp = stateMgr.GetLastRelayId();
|
||||
while (tmp != kInvalidUniqueId)
|
||||
{
|
||||
const CEntity* obj = stateMgr.GetObjectById(tmp);
|
||||
if (!obj)
|
||||
{
|
||||
tmp = x34_;
|
||||
tmp = x34_nextRelay;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -44,19 +44,19 @@ void CScriptRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CS
|
|||
|
||||
if (tmp == kInvalidUniqueId)
|
||||
return;
|
||||
x34_ = stateMgr.xf76_;
|
||||
stateMgr.xf76_ = GetUniqueId();
|
||||
x34_nextRelay = stateMgr.GetLastRelayId();
|
||||
stateMgr.SetLastRelayId(GetUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
void CScriptRelay::Think(float, CStateManager& stateMgr)
|
||||
{
|
||||
if (x38_ == 0)
|
||||
if (x38_refCount == 0)
|
||||
return;
|
||||
|
||||
while (x38_ != 0)
|
||||
while (x38_refCount != 0)
|
||||
{
|
||||
x38_--;
|
||||
x38_refCount--;
|
||||
SendScriptMsgs(EScriptObjectState::Zero, stateMgr, EScriptObjectMessage::None);
|
||||
}
|
||||
UpdateObjectRef(stateMgr);
|
||||
|
@ -64,17 +64,18 @@ void CScriptRelay::Think(float, CStateManager& stateMgr)
|
|||
|
||||
void CScriptRelay::UpdateObjectRef(CStateManager& stateMgr)
|
||||
{
|
||||
TUniqueId* tmp = &stateMgr.xf76_;
|
||||
TUniqueId* tmp = stateMgr.GetLastRelayIdPtr();
|
||||
while (*tmp != kInvalidUniqueId && tmp != nullptr)
|
||||
{
|
||||
if (*tmp == GetUniqueId())
|
||||
{
|
||||
*tmp = x34_;
|
||||
*tmp = x34_nextRelay;
|
||||
return;
|
||||
}
|
||||
const CScriptRelay* obj = TCastToConstPtr<CScriptRelay>(stateMgr.GetObjectById(*tmp));
|
||||
if (obj)
|
||||
tmp = (TUniqueId*)&obj->x34_;
|
||||
CScriptRelay* obj = dynamic_cast<CScriptRelay*>(stateMgr.ObjectById(*tmp));
|
||||
if (obj == nullptr)
|
||||
return;
|
||||
tmp = &obj->x34_nextRelay;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ namespace urde
|
|||
{
|
||||
class CScriptRelay : public CEntity
|
||||
{
|
||||
TUniqueId x34_ = kInvalidUniqueId;
|
||||
u32 x38_ = 0;
|
||||
TUniqueId x34_nextRelay = kInvalidUniqueId;
|
||||
u32 x38_refCount = 0;
|
||||
public:
|
||||
CScriptRelay(TUniqueId, const std::string&, const CEntityInfo&, bool);
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
#include "World/CScriptTargetingPoint.hpp"
|
||||
#include "World/CActorParameters.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
CScriptTargetingPoint::CScriptTargetingPoint(TUniqueId uid, const std::string& name, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, bool active)
|
||||
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown),
|
||||
CActorParameters::None(), kInvalidUniqueId)
|
||||
{
|
||||
}
|
||||
|
||||
void CScriptTargetingPoint::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
||||
|
||||
void CScriptTargetingPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr)
|
||||
{
|
||||
CActor::AcceptScriptMsg(msg, uid, mgr);
|
||||
|
||||
if (msg == EScriptObjectMessage::Deactivate || msg == EScriptObjectMessage::Activate)
|
||||
CEntity::SendScriptMsgs(EScriptObjectState::Attack, mgr, EScriptObjectMessage::None);
|
||||
}
|
||||
|
||||
void CScriptTargetingPoint::Think(float dt, CStateManager&)
|
||||
{
|
||||
if (xec_time <= 0.f)
|
||||
return;
|
||||
|
||||
xec_time -= dt;
|
||||
}
|
||||
|
||||
bool CScriptTargetingPoint::GetLocked() const { return !x20_conns.empty(); }
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef __URDE_CSCRIPTTARGETINGPOINT_HPP__
|
||||
#define __URDE_CSCRIPTTARGETINGPOINT_HPP__
|
||||
|
||||
#include "World/CActor.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
class CScriptTargetingPoint : public CActor
|
||||
{
|
||||
private:
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool xe8_e4_ : 1;
|
||||
};
|
||||
u8 xe8_dummy = 0;
|
||||
};
|
||||
TUniqueId xea_;
|
||||
float xec_time = 0.f;
|
||||
|
||||
public:
|
||||
CScriptTargetingPoint(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, bool);
|
||||
|
||||
void Accept(IVisitor& visitor);
|
||||
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &);
|
||||
void Think(float, CStateManager &);
|
||||
void Render(const CStateManager &) const {}
|
||||
|
||||
bool GetLocked() const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // __URDE_CSCRIPTTARGETINGPOINT_HPP__
|
|
@ -58,8 +58,8 @@ void CScriptTrigger::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CS
|
|||
x148_29_didPhazonDamage = false;
|
||||
}
|
||||
|
||||
if (x8_uid == mgr.GetLastTrigger())
|
||||
mgr.SetLastTrigger(kInvalidUniqueId);
|
||||
if (x8_uid == mgr.GetLastTriggerId())
|
||||
mgr.SetLastTriggerId(kInvalidUniqueId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,8 +229,8 @@ void CScriptTrigger::Touch(CActor& act, CStateManager& mgr)
|
|||
{
|
||||
|
||||
if (x128_forceMagnitude > 0.f && (x12c_flags & ETriggerFlags::DetectPlayer) != ETriggerFlags::None &&
|
||||
mgr.GetLastTrigger() == kInvalidUniqueId)
|
||||
mgr.SetLastTrigger(x8_uid);
|
||||
mgr.GetLastTriggerId() == kInvalidUniqueId)
|
||||
mgr.SetLastTriggerId(x8_uid);
|
||||
|
||||
testFlags |= ETriggerFlags::DetectPlayer;
|
||||
if (pl->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed)
|
||||
|
|
Loading…
Reference in New Issue