scriptenv?
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "ContentPack.h"
|
||||
#include "../logic/scripting/scripting.h"
|
||||
#include "../logic/scripting/Environment.h"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
@@ -328,7 +327,7 @@ void ContentLoader::load(ContentBuilder& builder) {
|
||||
|
||||
auto runtime = new ContentPackRuntime(*pack, scripting::create_pack_environment(*pack));
|
||||
builder.add(runtime);
|
||||
env = runtime->getEnvironment()->getId();
|
||||
env = runtime->getEnvironment();
|
||||
ContentPackStats& stats = runtime->getStatsWriteable();
|
||||
|
||||
fixPackIndices();
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace dynamic {
|
||||
|
||||
class ContentLoader {
|
||||
const ContentPack* pack;
|
||||
int env = 0;
|
||||
scriptenv env;
|
||||
|
||||
void loadBlock(Block& def, std::string full, std::string name);
|
||||
void loadCustomBlockModel(Block& def, dynamic::Map* primitives);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "../files/files.h"
|
||||
#include "../files/engine_paths.h"
|
||||
#include "../data/dynamic.h"
|
||||
#include "../logic/scripting/Environment.h"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
@@ -141,7 +140,7 @@ fs::path ContentPack::findPack(const EnginePaths* paths, fs::path worldDir, std:
|
||||
|
||||
ContentPackRuntime::ContentPackRuntime(
|
||||
ContentPack info,
|
||||
std::unique_ptr<scripting::Environment> env
|
||||
scriptenv env
|
||||
) : info(info), env(std::move(env))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef CONTENT_CONTENT_PACK_H_
|
||||
#define CONTENT_CONTENT_PACK_H_
|
||||
|
||||
#include "../typedefs.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
@@ -85,11 +87,11 @@ struct ContentPackStats {
|
||||
class ContentPackRuntime {
|
||||
ContentPack info;
|
||||
ContentPackStats stats {};
|
||||
std::unique_ptr<scripting::Environment> env;
|
||||
scriptenv env;
|
||||
public:
|
||||
ContentPackRuntime(
|
||||
ContentPack info,
|
||||
std::unique_ptr<scripting::Environment> env
|
||||
scriptenv env
|
||||
);
|
||||
~ContentPackRuntime();
|
||||
|
||||
@@ -109,8 +111,8 @@ public:
|
||||
return info;
|
||||
}
|
||||
|
||||
inline scripting::Environment* getEnvironment() const {
|
||||
return env.get();
|
||||
inline scriptenv getEnvironment() const {
|
||||
return env;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user