Exemple #1
0
        public static void HandleNotify(int entity)
        {
            string type    = GameInterface.Notify_Type();
            int    numArgs = GameInterface.Notify_NumArgs();

            Parameter[] paras = CollectParameters(numArgs);

            if (type == "touch")
            {
                return;
            }

            if (GameInterface.Script_GetObjectType(entity) == 21)
            {
                var entRef = GameInterface.Script_ToEntRef(entity);
                var entObj = Entity.GetEntity(entRef);

                entObj.HandleNotify(entity, type, paras);
            }
            else if (GameInterface.Script_GetObjectType(entity) == 24)
            {
                var entRef = GameInterface.Script_GetTempEntRef();
                var entObj = Entity.GetEntity(entRef);

                entObj.HandleNotify(entity, type, paras);
            }

            ScriptProcessor.RunAll(script => script.HandleNotify(GameInterface.Script_ToEntRef(entity), type, paras));
        }
        public static void HandleNotify(int entity)
        {
            string type    = GameInterface.Notify_Type();
            int    numArgs = GameInterface.Notify_NumArgs();

            var paras = CollectParameters(numArgs);

            if (type != "touch")
            {
                // dispatch the thingy
                if (GameInterface.Script_GetObjectType(entity) == 22) // actual entity
                {
                    var entRef = GameInterface.Script_ToEntRef(entity);
                    var entObj = Entity.GetEntity(entRef);

                    entObj.HandleNotify(entity, type, paras);
                }
                else if (GameInterface.Script_GetObjectType(entity) == 21) // not an actual entity
                {
                    var entRef = GameInterface.Script_GetTempEntRef();
                    var entObj = Entity.GetEntity(entRef);

                    entObj.HandleNotify(entity, type, paras);
                }

                ScriptProcessor.RunAll(script => script.HandleNotify(entity, type, paras));
            }
        }
Exemple #3
0
        public static void HandleNotify(int entity)
        {
            string type    = Marshal.PtrToStringAnsi(GameInterface.Notify_Type());
            int    numArgs = GameInterface.Notify_NumArgs();

            var paras = CollectParameters(numArgs);

            if (type != "touch")
            {
                // dispatch the thingy
                if (GameInterface.Script_GetObjectType(entity) == 21) // actual entity
                {
                    var entRef = GameInterface.Script_ToEntRef(entity);
                    var entObj = Entity.GetEntity(entRef);

                    //Log.Write(LogLevel.Trace, "{0} on object {1}, entRef {2} (entity object {3})", type, entity, entRef, entObj);

                    entObj.HandleNotify(entity, type, paras);
                }

                ScriptProcessor.RunAll(script => script.HandleNotify(entity, type, paras));
            }
        }