mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-02-28 21:59:49 +00:00
fix: imaginite on racing minigames and add null checks (#1958)
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#endif
|
||||
|
||||
RacingControlComponent::RacingControlComponent(Entity* parent, const int32_t componentID)
|
||||
: Component(parent, componentID) {
|
||||
: ActivityComponent(parent, componentID) {
|
||||
m_PathName = u"MainPath";
|
||||
m_NumberOfLaps = 3;
|
||||
m_RemainingLaps = m_NumberOfLaps;
|
||||
@@ -70,7 +70,7 @@ void RacingControlComponent::OnPlayerLoaded(Entity* player) {
|
||||
auto* vehicle = inventoryComponent->FindItemByLot(8092);
|
||||
|
||||
// If the race has already started, send the player back to the main world.
|
||||
if (m_Loaded || !vehicle) {
|
||||
if (m_Loaded || !vehicle || !TakeCost(player)) {
|
||||
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||
if (characterComponent) characterComponent->SendToZone(m_MainWorld);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user