Convert alot of methods to use TimeSpan.
This commit is contained in:
@@ -548,7 +548,7 @@ namespace Game.Maps
|
||||
Log.outDebug(LogFilter.Scripts, "InstanceScript: DoCloseDoorOrButton failed");
|
||||
}
|
||||
|
||||
public void DoRespawnGameObject(ObjectGuid guid, uint timeToDespawn)
|
||||
public void DoRespawnGameObject(ObjectGuid guid, TimeSpan timeToDespawn)
|
||||
{
|
||||
GameObject go = instance.GetGameObject(guid);
|
||||
if (go)
|
||||
@@ -569,7 +569,7 @@ namespace Game.Maps
|
||||
if (go.IsSpawned())
|
||||
return;
|
||||
|
||||
go.SetRespawnTime((int)timeToDespawn);
|
||||
go.SetRespawnTime((int)timeToDespawn.TotalSeconds);
|
||||
}
|
||||
else
|
||||
Log.outDebug(LogFilter.Scripts, "InstanceScript: DoRespawnGameObject failed");
|
||||
|
||||
@@ -4738,7 +4738,7 @@ namespace Game.Maps
|
||||
float z = step.script.TempSummonCreature.PosZ;
|
||||
float o = step.script.TempSummonCreature.Orientation;
|
||||
|
||||
if (pSummoner.SummonCreature(step.script.TempSummonCreature.CreatureEntry, x, y, z, o, TempSummonType.TimedOrDeadDespawn, step.script.TempSummonCreature.DespawnDelay) == null)
|
||||
if (pSummoner.SummonCreature(step.script.TempSummonCreature.CreatureEntry, x, y, z, o, TempSummonType.TimedOrDeadDespawn, TimeSpan.FromMilliseconds(step.script.TempSummonCreature.DespawnDelay)) == null)
|
||||
Log.outError(LogFilter.Scripts, "{0} creature was not spawned (entry: {1}).", step.script.GetDebugInfo(), step.script.TempSummonCreature.CreatureEntry);
|
||||
}
|
||||
}
|
||||
@@ -4884,7 +4884,7 @@ namespace Game.Maps
|
||||
// First try with target or source creature, then with target or source gameobject
|
||||
Creature cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script, true);
|
||||
if (cSource != null)
|
||||
cSource.DespawnOrUnsummon(step.script.DespawnSelf.DespawnDelay);
|
||||
cSource.DespawnOrUnsummon(TimeSpan.FromMilliseconds(step.script.DespawnSelf.DespawnDelay));
|
||||
else
|
||||
{
|
||||
GameObject goSource = _GetScriptGameObjectSourceOrTarget(source, target, step.script, true);
|
||||
|
||||
Reference in New Issue
Block a user