refactor some code to prevent possible crashes and bugs

This commit is contained in:
mq1n
2025-09-02 19:03:54 +03:00
parent 3de9fb33b5
commit 4ebc19a261
7 changed files with 86 additions and 64 deletions

View File

@@ -6010,13 +6010,13 @@ void CHARACTER::EffectPacket(int enumEffectType)
PacketAround(&p, sizeof(TPacketGCSpecialEffect));
}
void CHARACTER::SpecificEffectPacket(const char filename[MAX_EFFECT_FILE_NAME])
void CHARACTER::SpecificEffectPacket(const std::string& stEffectName)
{
TPacketGCSpecificEffect p;
p.header = HEADER_GC_SPECIFIC_EFFECT;
p.vid = GetVID();
memcpy (p.effect_file, filename, MAX_EFFECT_FILE_NAME);
strlcpy(p.effect_file, stEffectName.c_str(), sizeof(p.effect_file));
PacketAround(&p, sizeof(TPacketGCSpecificEffect));
}