mirror of https://github.com/OpenTTD/OpenTTD
Change: [Script] Don't allow scripts to instantiate ScriptEvent (#14276)
parent
2926179d02
commit
4b1b2a4310
|
@ -353,7 +353,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
||||||
else()
|
else()
|
||||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
|
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
|
||||||
endif()
|
endif()
|
||||||
if(NOT "${SUPER_CLS}" MATCHES "^ScriptEvent")
|
if(NOT "${SUPER_CLS}" MATCHES "^ScriptEvent" AND NOT "${CLS}" STREQUAL "ScriptEvent")
|
||||||
if("${CLS_PARAM_2}" STREQUAL "v")
|
if("${CLS_PARAM_2}" STREQUAL "v")
|
||||||
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.AddSQAdvancedConstructor(engine);")
|
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.AddSQAdvancedConstructor(engine);")
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -61,6 +61,7 @@ public:
|
||||||
ET_PRESIDENT_RENAMED,
|
ET_PRESIDENT_RENAMED,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef DOXYGEN_API
|
||||||
/**
|
/**
|
||||||
* Constructor of ScriptEvent, to get the type of event.
|
* Constructor of ScriptEvent, to get the type of event.
|
||||||
* @param type The type of event to construct.
|
* @param type The type of event to construct.
|
||||||
|
@ -68,6 +69,7 @@ public:
|
||||||
ScriptEvent(ScriptEvent::ScriptEventType type) :
|
ScriptEvent(ScriptEvent::ScriptEventType type) :
|
||||||
type(type)
|
type(type)
|
||||||
{}
|
{}
|
||||||
|
#endif /* DOXYGEN_API */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the event-type.
|
* Get the event-type.
|
||||||
|
|
|
@ -13,7 +13,7 @@ ${SQUIRREL_INCLUDES}
|
||||||
|
|
||||||
static SQInteger ${APIUC}ObjectConstructor(HSQUIRRELVM vm)
|
static SQInteger ${APIUC}ObjectConstructor(HSQUIRRELVM vm)
|
||||||
{
|
{
|
||||||
return sq_throwerror(vm, "${APIUC}Object is not instantiable");
|
return sq_throwerror(vm, "This class is not instantiable");
|
||||||
}
|
}
|
||||||
|
|
||||||
static SQInteger ${APIUC}ObjectCloned(HSQUIRRELVM)
|
static SQInteger ${APIUC}ObjectCloned(HSQUIRRELVM)
|
||||||
|
|
Loading…
Reference in New Issue