mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- added obituary fallbacks for actors that do not have any defined.
This is mainly for Dehacked mods which redefine decorations as monsters. The fallback names are DEFOB_{classname} or DEFITOB_{classname}.
This commit is contained in:
parent
5c4e8783e9
commit
1dde2ef597
1 changed files with 16 additions and 1 deletions
|
@ -266,7 +266,22 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker, int dmgf
|
|||
|
||||
if (message == NULL)
|
||||
{
|
||||
message = GStrings.GetString("OB_DEFAULT", nullptr, self->player->userinfo.GetGender());
|
||||
// one last thing: Synthesize a string label from the actor's class name and try to resolve that.
|
||||
auto cls = attacker->GetClass()->TypeName.GetChars();
|
||||
if (mod == NAME_Melee)
|
||||
{
|
||||
FStringf ob("DEFHITOB_%s", cls);
|
||||
message = GStrings.GetString(ob, nullptr, self->player->userinfo.GetGender());
|
||||
}
|
||||
if (message == nullptr)
|
||||
{
|
||||
FStringf ob("DEFOB_%s", cls);
|
||||
message = GStrings.GetString(ob, nullptr, self->player->userinfo.GetGender());
|
||||
}
|
||||
if (message == nullptr)
|
||||
{
|
||||
message = GStrings.GetString("OB_DEFAULT", nullptr, self->player->userinfo.GetGender());
|
||||
}
|
||||
}
|
||||
|
||||
// [CK] Don't display empty strings
|
||||
|
|
Loading…
Reference in a new issue