Skip to content

Commit

Permalink
Merge pull request #48 from okradonkey/patch-1
Browse files Browse the repository at this point in the history
Skip mote for pawn on different map
  • Loading branch information
krafs authored Apr 22, 2020
2 parents af851a4 + dd5362a commit 9f58a57
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Source/LevelEventMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ public void OnLevelChange(string baseMessage, MessageTypeDef messageType, SkillR
var message = new Message(text, messageType, new LookTargets(pawn));
Messages.Message(message, false);

var mote = ThingMaker.MakeThing(moteDef) as Mote;
mote.Scale = scale;
mote.rotationRate = rotationRate;
var position = pawn.DrawPos;
mote.Attach(pawn);
mote.exactPosition = position;
if (pawn.Map == Find.CurrentMap)
{
var mote = ThingMaker.MakeThing(moteDef) as Mote;
mote.Scale = scale;
mote.rotationRate = rotationRate;
var position = pawn.DrawPos;
mote.Attach(pawn);
mote.exactPosition = position;

GenSpawn.Spawn(mote, position.ToIntVec3(), Find.CurrentMap);
GenSpawn.Spawn(mote, position.ToIntVec3(), Find.CurrentMap);
}
}
}

Expand All @@ -63,4 +66,4 @@ private string PrepareLevelMessage(string key)
.Replace("{0}", "{0}".Colorize(ColoredText.NameColor));
}
}
}
}

0 comments on commit 9f58a57

Please sign in to comment.