prevent crash on unknown drowning figure
This commit is contained in:
parent
c5c1f32ce6
commit
255ee03aee
|
@ -948,7 +948,10 @@ func (x *HistoricalEventHfDied) Html(c *Context) string {
|
||||||
case HistoricalEventHfDiedCause_Suffocate, HistoricalEventHfDiedCause_Air:
|
case HistoricalEventHfDiedCause_Suffocate, HistoricalEventHfDiedCause_Air:
|
||||||
return hf + " suffocated, slain by " + slayer + loc
|
return hf + " suffocated, slain by " + slayer + loc
|
||||||
case HistoricalEventHfDiedCause_SuicideDrowned, HistoricalEventHfDiedCause_DrownAltTwo:
|
case HistoricalEventHfDiedCause_SuicideDrowned, HistoricalEventHfDiedCause_DrownAltTwo:
|
||||||
return hf + " drowned " + util.If(c.World.HistoricalFigures[x.Hfid].Female(), "herself ", "himself ") + loc
|
if f, ok := c.World.HistoricalFigures[x.Hfid]; ok {
|
||||||
|
return hf + " drowned " + util.If(f.Female(), "herself ", "himself ") + loc
|
||||||
|
}
|
||||||
|
return hf + " drowned themselves " + loc
|
||||||
case HistoricalEventHfDiedCause_SuicideLeaping, HistoricalEventHfDiedCause_LeaptFromHeight:
|
case HistoricalEventHfDiedCause_SuicideLeaping, HistoricalEventHfDiedCause_LeaptFromHeight:
|
||||||
return hf + " leapt from a great height" + loc
|
return hf + " leapt from a great height" + loc
|
||||||
case HistoricalEventHfDiedCause_Thirst:
|
case HistoricalEventHfDiedCause_Thirst:
|
||||||
|
|
Loading…
Reference in New Issue