Fix user action sound in local context

console-destruction
Sven Eberhardt 2016-08-23 01:20:54 -04:00
parent e18cee3a46
commit e4fad91d36
1 changed files with 10 additions and 1 deletions

View File

@ -787,7 +787,16 @@ private func EvalAct_Wait(proplist props, proplist context)
private func EvalAct_Sound(proplist props, proplist context)
{
if (!props.Sound) return;
var sound_context = props.SourceObject ?? Global;
var sound_context;
if (props.SourceObject)
{
sound_context = EvaluateValue("Object", props.SourceObject, context);
if (!sound_context) return;
}
else
{
sound_context = Global;
}
var volume = EvaluateValue("Integer", props.Volume, context);
var pitch = EvaluateValue("Integer", props.Pitch, context);
if (props.TargetPlayers == "all_players")