mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility Update lua_api.txt
This commit is contained in:
parent
2364449d7a
commit
3b9f99e0d6
5 changed files with 33 additions and 14 deletions
|
@ -184,16 +184,18 @@ private:
|
|||
std::set<std::string> m_required_neighbors;
|
||||
float m_trigger_interval;
|
||||
u32 m_trigger_chance;
|
||||
bool m_simple_catch_up;
|
||||
public:
|
||||
LuaABM(lua_State *L, int id,
|
||||
const std::set<std::string> &trigger_contents,
|
||||
const std::set<std::string> &required_neighbors,
|
||||
float trigger_interval, u32 trigger_chance):
|
||||
float trigger_interval, u32 trigger_chance, bool simple_catch_up):
|
||||
m_id(id),
|
||||
m_trigger_contents(trigger_contents),
|
||||
m_required_neighbors(required_neighbors),
|
||||
m_trigger_interval(trigger_interval),
|
||||
m_trigger_chance(trigger_chance)
|
||||
m_trigger_chance(trigger_chance),
|
||||
m_simple_catch_up(simple_catch_up)
|
||||
{
|
||||
}
|
||||
virtual std::set<std::string> getTriggerContents()
|
||||
|
@ -212,6 +214,10 @@ public:
|
|||
{
|
||||
return m_trigger_chance;
|
||||
}
|
||||
virtual bool getSimpleCatchUp()
|
||||
{
|
||||
return m_simple_catch_up;
|
||||
}
|
||||
virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n,
|
||||
u32 active_object_count, u32 active_object_count_wider);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue