Implemented lua, shaking out latent bugs
This commit is contained in:
@@ -104,6 +104,8 @@ static int unloadRegion(lua_State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//TODO: check that parameters are not null
|
||||
|
||||
static int setOnLoad(lua_State* L) {
|
||||
RegionPagerLua* pager = reinterpret_cast<RegionPagerLua*>(lua_touserdata(L, 1));
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, pager->GetLoadReference());
|
||||
|
||||
@@ -28,6 +28,8 @@ RegionPagerBase::~RegionPagerBase() {
|
||||
UnloadAll();
|
||||
};
|
||||
|
||||
//TODO: add nullptr checks to the calls to GetRegion()
|
||||
|
||||
Region::type_t RegionPagerBase::SetTile(int x, int y, int z, Region::type_t v) {
|
||||
Region* ptr = GetRegion(x, y);
|
||||
return ptr->SetTile(x - ptr->GetX(), y - ptr->GetY(), z, v);
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
//NOTE: set the lua hook before use
|
||||
|
||||
class RegionPagerLua : public RegionPagerBase {
|
||||
public:
|
||||
RegionPagerLua() = default;
|
||||
|
||||
Reference in New Issue
Block a user