mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
fixed editing bug
This commit is contained in:
@@ -55,7 +55,7 @@ public:
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
SetNetDormancy((ENetDormancy)(2 - (NewEditingPlayer != 0)));
|
SetNetDormancy((ENetDormancy)(2 - (NewEditingPlayer != 0)));
|
||||||
// they do something here
|
ForceNetUpdate();
|
||||||
GetEditingPlayer() = NewEditingPlayer;
|
GetEditingPlayer() = NewEditingPlayer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1694,8 +1694,6 @@ void AFortPlayerController::ServerBeginEditingBuildingActorHook(AFortPlayerContr
|
|||||||
if (!PlayerState)
|
if (!PlayerState)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BuildingActorToEdit->SetEditingPlayer(PlayerState);
|
|
||||||
|
|
||||||
auto WorldInventory = PlayerController->GetWorldInventory();
|
auto WorldInventory = PlayerController->GetWorldInventory();
|
||||||
|
|
||||||
if (!WorldInventory)
|
if (!WorldInventory)
|
||||||
@@ -1716,7 +1714,9 @@ void AFortPlayerController::ServerBeginEditingBuildingActorHook(AFortPlayerContr
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
EditTool->GetEditActor() = BuildingActorToEdit;
|
EditTool->GetEditActor() = BuildingActorToEdit;
|
||||||
EditTool->OnRep_EditActor();
|
// EditTool->OnRep_EditActor();
|
||||||
|
|
||||||
|
BuildingActorToEdit->SetEditingPlayer(PlayerState);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AFortPlayerController::ServerEditBuildingActorHook(UObject* Context, FFrame& Stack, void* Ret)
|
void AFortPlayerController::ServerEditBuildingActorHook(UObject* Context, FFrame& Stack, void* Ret)
|
||||||
@@ -1749,7 +1749,7 @@ void AFortPlayerController::ServerEditBuildingActorHook(UObject* Context, FFrame
|
|||||||
// if (!PlayerState || PlayerState->GetTeamIndex() != BuildingActorToEdit->GetTeamIndex())
|
// if (!PlayerState || PlayerState->GetTeamIndex() != BuildingActorToEdit->GetTeamIndex())
|
||||||
//return ServerEditBuildingActorOriginal(Context, Frame, Ret);
|
//return ServerEditBuildingActorOriginal(Context, Frame, Ret);
|
||||||
|
|
||||||
BuildingActorToEdit->SetEditingPlayer(nullptr);
|
// BuildingActorToEdit->SetEditingPlayer(nullptr);
|
||||||
|
|
||||||
static ABuildingSMActor* (*BuildingSMActorReplaceBuildingActor)(ABuildingSMActor*, __int64, UClass*, int, int, uint8_t, AFortPlayerController*) =
|
static ABuildingSMActor* (*BuildingSMActorReplaceBuildingActor)(ABuildingSMActor*, __int64, UClass*, int, int, uint8_t, AFortPlayerController*) =
|
||||||
decltype(BuildingSMActorReplaceBuildingActor)(Addresses::ReplaceBuildingActor);
|
decltype(BuildingSMActorReplaceBuildingActor)(Addresses::ReplaceBuildingActor);
|
||||||
@@ -1788,16 +1788,12 @@ void AFortPlayerController::ServerEndEditingBuildingActorHook(AFortPlayerControl
|
|||||||
if (!EditToolInstance)
|
if (!EditToolInstance)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid());
|
// Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid());
|
||||||
|
|
||||||
auto EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
|
auto EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
|
||||||
|
|
||||||
BuildingActorToStopEditing->GetEditingPlayer() = nullptr;
|
|
||||||
// BuildingActorToStopEditing->OnRep_EditingPlayer();
|
|
||||||
|
|
||||||
if (EditTool)
|
if (EditTool)
|
||||||
{
|
{
|
||||||
EditTool->GetEditActor() = nullptr;
|
EditTool->GetEditActor() = nullptr;
|
||||||
EditTool->OnRep_EditActor();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,3 +155,33 @@ FORCEINLINE bool IsValidChecked(const UObject* Test)
|
|||||||
|
|
||||||
return true; // FInternalUObjectBaseUtilityIsValidFlagsChecker::CheckObjectValidBasedOnItsFlags(Test);
|
return true; // FInternalUObjectBaseUtilityIsValidFlagsChecker::CheckObjectValidBasedOnItsFlags(Test);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Test
|
||||||
|
{
|
||||||
|
// IMPLICITLY: Test() { VFT = TestVFT }
|
||||||
|
// IMPLICITLY: void** VFT // 0x0
|
||||||
|
virtual void func() {}
|
||||||
|
virtual void people() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
TestVFT:
|
||||||
|
|
||||||
|
Test::func
|
||||||
|
Test::people
|
||||||
|
|
||||||
|
HelloVFT:
|
||||||
|
|
||||||
|
Hello::func
|
||||||
|
Test::people
|
||||||
|
Hello::func2
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Hello : Test
|
||||||
|
{
|
||||||
|
// IMPLICITLY: Hello() { VFT = HelloVFT }
|
||||||
|
void func() override { /**/ }
|
||||||
|
virtual void func2() {}
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user