Skip to content

Commit

Permalink
unfuck the server
Browse files Browse the repository at this point in the history
  • Loading branch information
jphuffman committed Jul 9, 2024
1 parent ec4bf93 commit 68befe3
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions SkyPiratesCoreDev/Data/Scripts/SkyPirates/SuitHydroRefiller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

namespace hydrorefiller
{

/// <summary>
/// it uhh refills your hydro man. trust.
/// </summary>
[MySessionComponentDescriptor(MyUpdateOrder.BeforeSimulation )]
public class Bession : MySessionComponentBase
public class Bigredbession : MySessionComponentBase
{
public double tock = 0;
public int delay = 30;
Expand All @@ -30,31 +32,34 @@ public override void UpdateBeforeSimulation()

foreach (var player in playerlist)
{
float hydro = MyVisualScriptLogicProvider.GetPlayersHydrogenLevel(player.Identity.IdentityId);

var UpdatedDictionary = new Dictionary<long, long>();
bool nohydro = hydro <= 0f;
// add to list if they are not in the list and they dotn have hydro
if (!playerdictionary.ContainsKey(player.Identity.IdentityId) && nohydro)
{
UpdatedDictionary[player.Identity.IdentityId] = 0;
}
else if (playerdictionary.ContainsKey(player.Identity.IdentityId))
if (player.Controller?.ControlledEntity?.Entity is IMyCharacter)
{
float hydro = MyVisualScriptLogicProvider.GetPlayersHydrogenLevel(player.Identity.IdentityId);

var elapsedTime = playerdictionary[player.Identity.IdentityId] + 1;
if (elapsedTime > delay)
var UpdatedDictionary = new Dictionary<long, long>();
bool nohydro = hydro <= 0f;
// add to list if they are not in the list and they dotn have hydro
if (!playerdictionary.ContainsKey(player.Identity.IdentityId) && nohydro)
{
MyVisualScriptLogicProvider.SetPlayersHydrogenLevel(player.Identity.IdentityId, 1f);

UpdatedDictionary[player.Identity.IdentityId] = 0;
}
else
else if (playerdictionary.ContainsKey(player.Identity.IdentityId))
{
UpdatedDictionary[player.Identity.IdentityId] = elapsedTime;

var elapsedTime = playerdictionary[player.Identity.IdentityId] + 1;
if (elapsedTime > delay)
{
MyVisualScriptLogicProvider.SetPlayersHydrogenLevel(player.Identity.IdentityId, 1f);

}
else
{
UpdatedDictionary[player.Identity.IdentityId] = elapsedTime;
}
}
}

playerdictionary = UpdatedDictionary;
playerdictionary = UpdatedDictionary;
}
}

}
Expand Down

0 comments on commit 68befe3

Please sign in to comment.