Fix: prevent ActorFactory from logging errors for logical/non-renderable spawner SNOs.
This commit is contained in:
parent
8864741d3d
commit
a430be9bfa
@ -39,13 +39,30 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
|
||||
public static Actor Create(World world, ActorSno sno, TagMap tags, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
|
||||
{
|
||||
if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey((int)sno))
|
||||
if (sno == ActorSno.__NONE)
|
||||
{
|
||||
var path = Path.GetFileName(filePath);
|
||||
Logger.Trace($"$[underline red on white]$Actor asset not found$[/]$, Method: $[olive]${memberName}()$[/]$ - $[underline white]${memberName}() in {path}:{lineNumber}$[/]$");
|
||||
// SNOSpawn == 0/none → never generates an Actor.
|
||||
Logger.Debug($"[ActorFactory] Ignorando ActorSno.__NONE");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey((int)sno))
|
||||
{
|
||||
string snoName = sno.ToString().ToLower();
|
||||
|
||||
// If the name itself indicates that it is a spawner/marker/symbol → it is not an error, just ignore it.
|
||||
if (snoName.Contains("spawn") || snoName.Contains("spawner") ||
|
||||
snoName.Contains("symbol") || snoName.Contains("marker"))
|
||||
{
|
||||
Logger.Debug($"[ActorFactory] Ignorando actor lógico {sno} (sem asset renderizável no MPQ)");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Otherwise → it is indeed an expected asset that does not exist → log error.
|
||||
var path = Path.GetFileName(filePath);
|
||||
Logger.Trace($"$[underline red on white]$Actor asset not found$[/]$, Method: $[olive]{memberName}()$[/]$ - $[underline white]{memberName}() in {path}:{lineNumber}$[/]$");
|
||||
return null;
|
||||
}
|
||||
switch (sno)
|
||||
{
|
||||
case ActorSno._woodwraith_a_01:
|
||||
|
||||
@ -267,19 +267,19 @@ namespace DiIiS_NA.GameServer.GSSystem.MapSystem
|
||||
{
|
||||
//Logger.Warn("load Encounter marker {0} in {1} ({2})", marker.Name, markerSetData.FileName, marker.SNOHandle.Id);
|
||||
var encounter = marker.SNOHandle.Target as Encounter;
|
||||
var actorsno = RandomHelper.RandomItem(encounter.Spawnoptions, x => x.Probability);
|
||||
/*foreach (var option in encounter.Spawnoptions)
|
||||
|
||||
var selected = RandomHelper.RandomItem(encounter.Spawnoptions, x => x.Probability);
|
||||
|
||||
// Ignores invalid/non-existent spawns.
|
||||
if ((ActorSno)selected.SNOSpawn == ActorSno.__NONE) continue;
|
||||
|
||||
if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey(selected.SNOSpawn))
|
||||
{
|
||||
Logger.Trace("Encounter option {0} - {1} - {2} - {3}", option.SNOSpawn, option.Probability, option.I1, option.I2);
|
||||
}*/ //only for debugging purposes
|
||||
if ((ActorSno)actorsno.SNOSpawn == ActorSno.__NONE)
|
||||
{
|
||||
var path = Path.GetFileName(filePath);
|
||||
Logger.Trace($"$[underline red on white]$Actor asset not found$[/]$, Method: $[olive]${memberName}()$[/]$ - $[underline white]${memberName}() in {path}:{lineNumber}$[/]$");
|
||||
Logger.Debug($"[Encounter] Ignorando SNO {selected.SNOSpawn} (sem asset)");
|
||||
continue;
|
||||
}
|
||||
|
||||
var actor2 = ActorFactory.Create(World, (ActorSno)actorsno.SNOSpawn, marker.TagMap); // try to create it.
|
||||
var actor2 = ActorFactory.Create(World, (ActorSno)selected.SNOSpawn, marker.TagMap);
|
||||
if (actor2 == null) continue;
|
||||
|
||||
var position2 = marker.PRTransform.Vector3D + Position; // calculate the position for the actor.
|
||||
|
||||
Loading…
Reference in New Issue
user.block.title