Line data Source code
1 : /** 2 : * Simple wrapper function for playing sounds that are associated with entities 3 : * @param name Typically one of 'walk', 'run', 'attack', 'death', 'build', 4 : * 'gather_fruit', 'gather_grain', 'gather_wood', 'gather_stone', 'gather_metal' 5 : */ 6 : function PlaySound(name, ent) 7 : { 8 4 : var cmpSound = Engine.QueryInterface(ent, IID_Sound); 9 4 : if (cmpSound) 10 0 : cmpSound.PlaySoundGroup(name); 11 : } 12 : 13 4 : Engine.RegisterGlobal("PlaySound", PlaySound);