Skip to content

Commit

Permalink
Fix multiple instances is not an error, it's gracefully handled.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterekepeter committed Aug 7, 2024
1 parent e7c3820 commit c09fc91
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions MVES/Classes/MapVote.uc
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,15 @@ event PostBeginPlay()
local bool bGotoSuccess;
local bool bNeedToRestorePackages, bNeedToRestoreMap;

Log("[MVE] Map Vote Extended version: "$ClientPackageInternal);

if ( IsOtherInstanceRunning() )
{
Err("Detected multiple instances of MapVote");
Err("Please use Mapvote either as ServerActor or Mutator");
Err("Never add it as both ServerActor and Mutator at the same time");
Nfo("Detected multiple MapVotes, only first mapvote will work.");
Destroy();
return;
}

Log("[MVE] Map Vote Extended version: "$ClientPackageInternal);

TravelInfo = Spawn(class'MV_TravelInfo');
Spawn(class'MapVoteDelayedInit').InitializeDelayedInit(Self);
Spawn(class'MV_IdleTimer').Initialize(Self, TravelInfo.bIsIdle, TravelInfo.EmptyMinutes);
Expand Down Expand Up @@ -479,7 +477,6 @@ event PostBeginPlay()
function bool IsOtherInstanceRunning()
{
local Mutator M;
local bool bIsThisRegistered, bIsAnotherRegistered;

// Check if mutator was added to GameInfo
for ( M = Level.Game.BaseMutator; M != None; M = M.NextMutator )
Expand Down

0 comments on commit c09fc91

Please sign in to comment.