syntax update

This commit is contained in:
Dmitry 2026-03-23 23:30:46 +07:00
parent 77243d4678
commit 7faeefd9f0
2 changed files with 3 additions and 3 deletions

View file

@ -172,7 +172,7 @@ public sealed class SuicideSystem : EntitySystem
// Corvax-IPC-start
//args.DamageType ??= "Bloodloss";
string entityPrototypeId = "";
if (EntityManager.TryGetComponent<MetaDataComponent>(victim, out var metaData) && metaData.EntityPrototype != null)
if (TryComp(victim, out MetaDataComponent? metaData) && metaData.EntityPrototype != null)
entityPrototypeId = metaData.EntityPrototype.ID;
if (entityPrototypeId != "MobIpc")

View file

@ -118,12 +118,12 @@ public sealed class TelephoneSystem : SharedTelephoneSystem
// If speaker entity has TTS, the telephone will speak with the same voice
if(TryComp<TTSComponent>(args.MessageSource, out var ttsSpeaker))
{
EntityManager.EnsureComponent<TTSComponent>(entity, out var ttsTelephone);
var ttsTelephone = EnsureComp<TTSComponent>(entity);
ttsTelephone.VoicePrototypeId = ttsSpeaker.VoicePrototypeId;
}
else // Remove TTS if the speaker has no TTS
{
EntityManager.RemoveComponent<TTSComponent>(entity);
RemComp<TTSComponent>(entity);
}
// Corvax-TTS-End
_chat.TrySendInGameICMessage(speaker, args.Message, volume, range, nameOverride: name, checkRadioPrefix: false);