add SpawnTableOnUse (#32620)
* add SpawnTableOnUse * make BaseEmitSound more flexible and remove sound from spawntable * add log * :trollface: --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -145,14 +145,22 @@ public abstract class SharedEmitSoundSystem : EntitySystem
|
||||
if (component.Sound == null)
|
||||
return;
|
||||
|
||||
if (predict)
|
||||
if (component.Positional)
|
||||
{
|
||||
_audioSystem.PlayPredicted(component.Sound, uid, user);
|
||||
var coords = Transform(uid).Coordinates;
|
||||
if (predict)
|
||||
_audioSystem.PlayPredicted(component.Sound, coords, user);
|
||||
else if (_netMan.IsServer)
|
||||
// don't predict sounds that client couldn't have played already
|
||||
_audioSystem.PlayPvs(component.Sound, coords);
|
||||
}
|
||||
else if (_netMan.IsServer)
|
||||
else
|
||||
{
|
||||
// don't predict sounds that client couldn't have played already
|
||||
_audioSystem.PlayPvs(component.Sound, uid);
|
||||
if (predict)
|
||||
_audioSystem.PlayPredicted(component.Sound, uid, user);
|
||||
else if (_netMan.IsServer)
|
||||
// don't predict sounds that client couldn't have played already
|
||||
_audioSystem.PlayPvs(component.Sound, uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user