Styling edits

This commit is contained in:
Aaron Kimbre 2022-05-04 18:24:28 -05:00
parent e81acb4c67
commit ad5c679d2d
3 changed files with 16 additions and 3 deletions

View File

@ -30,8 +30,8 @@ void RocketLaunchLupComponent::OnUse(Entity* originator) {
auto* characterComponent = originator->GetComponent<CharacterComponent>(); auto* characterComponent = originator->GetComponent<CharacterComponent>();
if (!inventoryComponent || !characterComponent) return; if (!inventoryComponent || !characterComponent) return;
Item* rocket = nullptr;
rocket = inventoryComponent->FindItemById(characterComponent->GetLastRocketItemID()); Item* rocket = inventoryComponent->FindItemById(characterComponent->GetLastRocketItemID());
if (!rocket) return; if (!rocket) return;
rocket->Equip(true); rocket->Equip(true);

View File

@ -15,9 +15,22 @@ public:
RocketLaunchLupComponent(Entity* parent); RocketLaunchLupComponent(Entity* parent);
~RocketLaunchLupComponent() override; ~RocketLaunchLupComponent() override;
/**
* Handles an OnUse event from some entity, preparing it for launch to some other world
* Builds m_LUPWorlds
* @param originator the entity that triggered the event
*/
void OnUse(Entity* originator) override; void OnUse(Entity* originator) override;
/**
* Handles an OnUse event from some entity, preparing it for launch to some other world
*
* @param originator the entity that triggered the event
* @param index index of the world that was selected
* @param sysAddr the address to send gamemessage responses to
*/
void OnSelectWorld(Entity* originator, uint32_t index, const SystemAddress& sysAddr); void OnSelectWorld(Entity* originator, uint32_t index, const SystemAddress& sysAddr);
private: private:
// vector of the LUP World Zone IDs, built from CDServer's LUPZoneIDs table
std::vector<LWOMAPID> m_LUPWorlds {}; std::vector<LWOMAPID> m_LUPWorlds {};
}; };

View File

@ -2733,7 +2733,7 @@ void GameMessages::HandleEnterProperty(RakNet::BitStream* inStream, Entity* enti
} }
auto rocketLaunchLupComponent = entity->GetComponent<RocketLaunchLupComponent>(); auto rocketLaunchLupComponent = entity->GetComponent<RocketLaunchLupComponent>();
if (rocketLaunchLupComponent) { if (rocketLaunchLupComponent != nullptr) {
rocketLaunchLupComponent->OnSelectWorld(player, index, sysAddr); rocketLaunchLupComponent->OnSelectWorld(player, index, sysAddr);
} }
} }