forked from Mirrors/openclonk
moved LaunchMeteor into more general Objects.ocd/System.ocg folder
This is to prevent errors on including objects that contain global functions. I believe this will be needed more in the future, thus there is now a new System.ocg folder.Controls
parent
6257d9d6be
commit
cc876e01ce
|
@ -82,19 +82,6 @@ public func FxIntMeteorControlSaveScen(obj, fx, props)
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
Launches a meteor.
|
||||
The meteor can spawn objects via spawn_id.
|
||||
*/
|
||||
global func LaunchMeteor(int x, int y, int size, int xdir, int ydir, id spawn_id, int spawn_amount)
|
||||
{
|
||||
var meteor_skin = Meteor;
|
||||
if (spawn_id) meteor_skin = spawn_id->~GetMeteorSkin() ?? meteor_skin;
|
||||
|
||||
var meteor = CreateObject(meteor_skin);
|
||||
return meteor->Launch(x, y, size, xdir, ydir, spawn_id, spawn_amount);
|
||||
}
|
||||
|
||||
/*-- Meteor --*/
|
||||
|
||||
public func Launch(int x, int y, int size, int xdir, int ydir, id spawn_id, int spawn_amount)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
Contains functions that require definitions from the "disasters" folder.
|
||||
*/
|
||||
|
||||
/**
|
||||
Launches a meteor.
|
||||
The meteor can spawn objects via spawn_id.
|
||||
*/
|
||||
global func LaunchMeteor(int x, int y, int size, int xdir, int ydir, id spawn_id, int spawn_amount)
|
||||
{
|
||||
var meteor_skin = Meteor;
|
||||
if (spawn_id) meteor_skin = spawn_id->~GetMeteorSkin() ?? meteor_skin;
|
||||
|
||||
var meteor = CreateObject(meteor_skin);
|
||||
return meteor->Launch(x, y, size, xdir, ydir, spawn_id, spawn_amount);
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
This folder contains general functions that would otherwise go into the global System.ocg but depend on definitions in Objects.ocd.
|
||||
That way, the game can also be used without errors when Objects.ocd is not loaded.
|
Loading…
Reference in New Issue