NScumm.Sword1.Logic.fnEnterSection C# (CSharp) Method

fnEnterSection() private method

private fnEnterSection ( SwordObject cpt, int id, int screen, int d, int e, int f, int z, int x ) : int
cpt SwordObject
id int
screen int
d int
e int
f int
z int
x int
return int
        private int fnEnterSection(SwordObject cpt, int id, int screen, int d, int e, int f, int z, int x)
        {
            if (screen >= ObjectMan.TOTAL_SECTIONS)
                throw new InvalidOperationException($"mega {id} tried entering section {screen}");

            /* if (cpt.o_type == TYPE_PLAYER)
               ^= this was the original condition from the game sourcecode.
               not sure why it doesn't work*/
            if (id == PLAYER)
                ScriptVars[(int)ScriptVariableNames.NEW_SCREEN] = (uint)screen;
            else
                cpt.screen = screen; // move the mega
            _objMan.MegaEntering((ushort)screen);
            return SCRIPT_CONT;
        }