mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 19:02:21 +01:00
Fixed Devourer of Worlds Event, Fixed chapter 2+ editing bug, Fixed all other bugs with editing, Fixed S13+ lategame.
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "BuildingActor.h"
|
|
#include "PlayerState.h"
|
|
|
|
enum class EFortResourceType : uint8_t
|
|
{
|
|
Wood = 0,
|
|
Stone = 1,
|
|
Metal = 2,
|
|
Permanite = 3,
|
|
None = 4,
|
|
EFortResourceType_MAX = 5
|
|
};
|
|
|
|
class ABuildingSMActor : public ABuildingActor
|
|
{
|
|
public:
|
|
bool IsPlayerPlaced()
|
|
{
|
|
static auto bPlayerPlacedOffset = GetOffset("bPlayerPlaced");
|
|
static auto bPlayerPlacedFieldMask = GetFieldMask(this->GetProperty("bPlayerPlaced"));
|
|
return ReadBitfieldValue(bPlayerPlacedOffset, bPlayerPlacedFieldMask);
|
|
}
|
|
|
|
void SetPlayerPlaced(bool NewValue)
|
|
{
|
|
static auto bPlayerPlacedOffset = GetOffset("bPlayerPlaced");
|
|
static auto bPlayerPlacedFieldMask = GetFieldMask(this->GetProperty("bPlayerPlaced"));
|
|
this->SetBitfieldValue(bPlayerPlacedOffset, bPlayerPlacedFieldMask, NewValue);
|
|
}
|
|
|
|
APlayerState*& GetEditingPlayer()
|
|
{
|
|
static auto EditingPlayerOffset = GetOffset("EditingPlayer");
|
|
return Get<APlayerState*>(EditingPlayerOffset);
|
|
}
|
|
|
|
int& GetCurrentBuildingLevel()
|
|
{
|
|
static auto CurrentBuildingLevelOffset = GetOffset("CurrentBuildingLevel");
|
|
return Get<int>(CurrentBuildingLevelOffset);
|
|
}
|
|
|
|
EFortResourceType& GetResourceType()
|
|
{
|
|
static auto ResourceTypeOffset = GetOffset("ResourceType");
|
|
return Get<EFortResourceType>(ResourceTypeOffset);
|
|
}
|
|
|
|
void SetEditingPlayer(APlayerState* NewEditingPlayer) // actually AFortPlayerStateZone
|
|
{
|
|
if (// AActor::HasAuthority() &&
|
|
(!GetEditingPlayer() || !NewEditingPlayer)
|
|
)
|
|
{
|
|
SetNetDormancy((ENetDormancy)(2 - (NewEditingPlayer != 0)));
|
|
// they do something here
|
|
GetEditingPlayer() = NewEditingPlayer;
|
|
}
|
|
}
|
|
|
|
static UClass* StaticClass();
|
|
}; |