Exported client functions to lua, going to work on npc next

This commit is contained in:
KimLS
2013-05-26 12:44:33 -07:00
parent 79a9d2112a
commit 850fa5aecc
7 changed files with 1259 additions and 85 deletions
+2 -9
View File
@@ -10,10 +10,10 @@
#include <stdio.h>
#include <sstream>
#include <vector>
#include <algorithm>
#include "masterentity.h"
#include "../common/spdat.h"
#include "../common/seperator.h"
#include "lua_entity.h"
#include "lua_item.h"
#include "lua_iteminst.h"
@@ -767,14 +767,7 @@ void LuaParser::LoadScript(std::string filename, std::string package_name) {
}
bool LuaParser::HasFunction(std::string subname, std::string package_name) {
size_t sz = subname.length();
for(size_t i = 0; i < sz; ++i) {
char c = subname[i];
if(65 <= c && c <= 90) {
c += 32;
}
subname[i] = c;
}
std::transform(subname.begin(), subname.end(), subname.begin(), ::tolower);
auto iter = loaded_.find(package_name);
if(iter == loaded_.end()) {