- added ACS and DECORATE setter functions for named translations.

This commit is contained in:
Christoph Oelckers 2016-10-02 14:09:45 +02:00
commit 0bce6e3925
5 changed files with 58 additions and 1 deletions

View file

@ -6525,6 +6525,23 @@ int AActor::ApplyDamageFactor(FName damagetype, int damage) const
}
void AActor::SetTranslation(const char *trname)
{
if (*trname == 0)
{
// an empty string resets to the default
Translation = GetDefault()->Translation;
return;
}
int tnum = R_FindCustomTranslation(trname);
if (tnum >= 0)
{
Translation = tnum;
}
// silently ignore if the name does not exist, this would create some insane message spam otherwise.
}
//----------------------------------------------------------------------------
//
// DropItem handling