That's why I now fixed and tested (or, more like orcwarrior tested it, I got no version of G1) the code for you:
func void ChestRename() {
var oCMob Mob;
var oCMobContainer Skrzynia;
var oCNpc her; her = Hlp_GetNpc(pc_hero);
if(her.focus_vob)
{
if(MEM_ReadInt(her.focus_vob)==oCMobContainer_vtbl)
{
MEM_AssignContentInst (Mob,her.focus_vob);
MEM_AssignContentInst (Skrzynia,her.focus_vob);
if (MEM_ReadInt(MEM_InstToPtr(Skrzynia)+604) == 0) {
MEM_ReinitParser();
var string newName; newName = "Pusta Skrzynia";
var int NameSymbIndex; NameSymbIndex = MEM_FindParserSymbol("CHESTRENAME.NEWNAME"); // NAME OF THE VARIABLE!
Mob.focusNameIndex = NameSymbIndex;
};
};
};
};
Just be careful with the function-name, if you change it, you have to adjust the string "CHESTRENAME.NEWNAME" since 'locals' in Gothic are named like this: <FUNC>.<VARNAME>