add some more logging to help track down this jealous desync bug

This commit is contained in:
Chris Forbes
2010-05-29 12:13:09 +12:00
parent d824373853
commit ac10ca3fad
2 changed files with 13 additions and 7 deletions

View File

@@ -193,14 +193,16 @@ namespace OpenRA
if (RemoveOnDeath) if (RemoveOnDeath)
World.AddFrameEndTask(w => w.Remove(this)); World.AddFrameEndTask(w => w.Remove(this));
Log.Write("{0} #{1} killed by {2} #{3}", Info.Name, ActorID, attacker.Info.Name, attacker.ActorID);
} }
var maxHP = this.GetMaxHP(); var maxHP = this.GetMaxHP();
if (Health > maxHP) Health = maxHP; if (Health > maxHP) Health = maxHP;
Log.Write("InflictDamage: {0} #{1} -> {2} #{3} raw={4} adj={5} hp={6} mod={7}", // Log.Write("InflictDamage: {0} #{1} -> {2} #{3} raw={4} adj={5} hp={6} mod={7}",
attacker.Info.Name, attacker.ActorID, Info.Name, ActorID, rawDamage, damage, Health, modifier); // attacker.Info.Name, attacker.ActorID, Info.Name, ActorID, rawDamage, damage, Health, modifier);
var newState = GetDamageState(); var newState = GetDamageState();

View File

@@ -36,9 +36,6 @@ namespace OpenRA.Traits
public class Production : IIssueOrder, IResolveOrder, ITags public class Production : IIssueOrder, IResolveOrder, ITags
{ {
bool isPrimary = false;
public bool IsPrimary { get { return isPrimary; } }
public Production( Actor self ) { } public Production( Actor self ) { }
public virtual int2? CreationLocation( Actor self, ActorInfo producee ) public virtual int2? CreationLocation( Actor self, ActorInfo producee )
@@ -96,9 +93,16 @@ namespace OpenRA.Traits
foreach (var t in self.traits.WithInterface<INotifyProduction>()) foreach (var t in self.traits.WithInterface<INotifyProduction>())
t.UnitProduced(self, newUnit); t.UnitProduced(self, newUnit);
Log.Write("{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID);
return true; return true;
} }
// "primary building" crap - perhaps this should be split?
bool isPrimary = false;
public bool IsPrimary { get { return isPrimary; } }
public IEnumerable<TagType> GetTags() public IEnumerable<TagType> GetTags()
{ {
yield return (isPrimary) ? TagType.Primary : TagType.None; yield return (isPrimary) ? TagType.Primary : TagType.None;