-
Notifications
You must be signed in to change notification settings - Fork 1
/
GameMode.cpp
50 lines (38 loc) · 974 Bytes
/
GameMode.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "pch.h"
#include "GameMode.h"
AGameMode::AGameMode(AGameModeBase* GameModeBase) : AGameModeBase(GameModeBase->InternalObject)
{
this->Setup();
}
AGameMode::AGameMode(InternalUObject* InternalObject) : AGameModeBase(InternalObject)
{
}
void AGameMode::Setup()
{
__super::Setup();
SetPointer(XOR(L"Function /Script/Engine.GameMode:StartMatch"), &Fn_StartMatch, &CanExec_StartMatch);
SetPointer(XOR(L"Function /Script/Engine.GameMode:Say"), &Fn_Say, &CanExec_Say);
}
void AGameMode::StartMatch()
{
if (!CanExec_StartMatch) return;
if (Util::IsBadReadPtr(InternalObject))
{
PLOGE << "InternalObject is nullptr";
}
if (Util::IsBadReadPtr(Fn_StartMatch))
{
PLOGE << "Fn_StartMatch is nullptr";
}
ProcessNoParamsEvent(InternalObject, Fn_StartMatch);
}
void AGameMode::Say(FString Msg)
{
if (!CanExec_Say) return;
struct Params {
FString Msg;
};
auto params = Params();
params.Msg = Msg;
ProcessEvent(InternalObject, Fn_Say, ¶ms);
}