forked from github/server
Merge branch 'master' into develop
Conflicts: src/bind_region.c src/buildno.h src/kernel/item.c
This commit is contained in:
commit
89bc83c4ab
|
@ -355,7 +355,7 @@ static int tolua_region_get_resource(lua_State * L)
|
||||||
const char *type;
|
const char *type;
|
||||||
const resource_type *rtype;
|
const resource_type *rtype;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
void * matches;
|
void * match;
|
||||||
critbit_tree * cb = special_resources();
|
critbit_tree * cb = special_resources();
|
||||||
|
|
||||||
r = (region *)tolua_tousertype(L, 1, 0);
|
r = (region *)tolua_tousertype(L, 1, 0);
|
||||||
|
@ -363,8 +363,8 @@ static int tolua_region_get_resource(lua_State * L)
|
||||||
type = tolua_tostring(L, 2, 0);
|
type = tolua_tostring(L, 2, 0);
|
||||||
LUA_ASSERT(type != NULL, "invalid parameter");
|
LUA_ASSERT(type != NULL, "invalid parameter");
|
||||||
|
|
||||||
if (cb_find_prefix(cb, type, strlen(type) + 1, &matches, 1, 0)) {
|
if (cb_find_prefix(cb, type, strlen(type) + 1, &match, 1, 0)) {
|
||||||
cb_get_kv(matches, &result, sizeof(result));
|
cb_get_kv(match, &result, sizeof(result));
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -399,10 +399,10 @@ static int tolua_region_set_resource(lua_State * L)
|
||||||
const char *type = tolua_tostring(L, 2, 0);
|
const char *type = tolua_tostring(L, 2, 0);
|
||||||
int result, value = (int)tolua_tonumber(L, 3, 0);
|
int result, value = (int)tolua_tonumber(L, 3, 0);
|
||||||
critbit_tree * cb = special_resources();
|
critbit_tree * cb = special_resources();
|
||||||
void * matches;
|
void * match;
|
||||||
|
|
||||||
if (cb_find_prefix(cb, type, strlen(type) + 1, &matches, 1, 0)) {
|
if (cb_find_prefix(cb, type, strlen(type) + 1, &match, 1, 0)) {
|
||||||
cb_get_kv(matches, &result, sizeof(result));
|
cb_get_kv(match, &result, sizeof(result));
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
@ -384,11 +384,11 @@ const potion_type *resource2potion(const resource_type * rtype)
|
||||||
|
|
||||||
resource_type *rt_find(const char *name)
|
resource_type *rt_find(const char *name)
|
||||||
{
|
{
|
||||||
void * matches;
|
void * match;
|
||||||
resource_type *result = 0;
|
resource_type *result = 0;
|
||||||
|
|
||||||
if (cb_find_prefix(&cb_resources, name, strlen(name) + 1, &matches, 1, 0)) {
|
if (cb_find_prefix(&cb_resources, name, strlen(name) + 1, &match, 1, 0)) {
|
||||||
cb_get_kv(matches, &result, sizeof(result));
|
cb_get_kv(match, &result, sizeof(result));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue