Permalink
Browse files

don't crash when sound rules are not loaded

e.g. when trying to get the gamefiles
  • Loading branch information...
1 parent f0708ec commit 208a3a47fe6f5e4310349f98ce90a77b76f41fbf @Mailaender committed with chrisforbes Jul 4, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 OpenRA.Game/Sound.cs
@@ -251,7 +251,10 @@ public static bool PlayPredefined(Player p, Actor voicedUnit, string type, strin
{
if (definition == null) return false;
+ if (Rules.Voices == null) return false;
+ if (Rules.Notifications == null) return false;
var rules = (voicedUnit != null) ? Rules.Voices[type] : Rules.Notifications[type];
+ if (rules == null) return false;
var ID = (voicedUnit != null) ? voicedUnit.ActorID : 0;

0 comments on commit 208a3a4

Please sign in to comment.