Content fixes for timeoffsets (#15934)
This commit is contained in:
@@ -59,6 +59,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
base.Initialize();
|
||||
Sawmill = Logger.GetSawmill("melee");
|
||||
|
||||
SubscribeLocalEvent<MeleeWeaponComponent, EntityUnpausedEvent>(OnMeleeUnpaused);
|
||||
SubscribeLocalEvent<MeleeWeaponComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<MeleeWeaponComponent, ComponentHandleState>(OnHandleState);
|
||||
SubscribeLocalEvent<MeleeWeaponComponent, HandDeselectedEvent>(OnMeleeDropped);
|
||||
@@ -77,11 +78,16 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
|
||||
private void OnMapInit(EntityUid uid, MeleeWeaponComponent component, MapInitEvent args)
|
||||
{
|
||||
if (component.NextAttack > TimeSpan.Zero)
|
||||
if (component.NextAttack > Timing.CurTime)
|
||||
Logger.Warning($"Initializing a map that contains an entity that is on cooldown. Entity: {ToPrettyString(uid)}");
|
||||
#endif
|
||||
}
|
||||
|
||||
private void OnMeleeUnpaused(EntityUid uid, MeleeWeaponComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextAttack += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnMeleeSelected(EntityUid uid, MeleeWeaponComponent component, HandSelectedEvent args)
|
||||
{
|
||||
if (component.AttackRate.Equals(0f))
|
||||
|
||||
Reference in New Issue
Block a user