1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Don't unload blocks if save failed

Improve error handling in saveBlock()
This commit is contained in:
kwolekr 2014-07-07 01:20:25 -04:00
parent e14c4cdd4c
commit 8b3ed78e53
11 changed files with 108 additions and 67 deletions

View file

@ -24,19 +24,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irr_v3d.h"
#include "irrlichttypes.h"
#ifndef PP
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
#endif
class MapBlock;
class Database
{
public:
virtual void beginSave()=0;
virtual void endSave()=0;
virtual void beginSave() = 0;
virtual void endSave() = 0;
virtual void saveBlock(MapBlock *block)=0;
virtual MapBlock* loadBlock(v3s16 blockpos)=0;
virtual bool saveBlock(MapBlock *block) = 0;
virtual MapBlock *loadBlock(v3s16 blockpos) = 0;
s64 getBlockAsInteger(const v3s16 pos) const;
v3s16 getIntegerAsBlock(s64 i) const;
virtual void listAllLoadableBlocks(std::list<v3s16> &dst)=0;
virtual void listAllLoadableBlocks(std::list<v3s16> &dst) = 0;
virtual int Initialized(void)=0;
virtual ~Database() {};
};