Merge branch 'master' into develop

Conflicts:
	src/bind_region.c
	src/buildno.h
	src/kernel/item.c
This commit is contained in:
Enno Rehling 2015-08-20 16:58:07 +02:00
commit 89bc83c4ab
2 changed files with 9 additions and 9 deletions

View File

@ -355,7 +355,7 @@ static int tolua_region_get_resource(lua_State * L)
const char *type;
const resource_type *rtype;
int result = 0;
void * matches;
void * match;
critbit_tree * cb = special_resources();
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);
LUA_ASSERT(type != NULL, "invalid parameter");
if (cb_find_prefix(cb, type, strlen(type) + 1, &matches, 1, 0)) {
cb_get_kv(matches, &result, sizeof(result));
if (cb_find_prefix(cb, type, strlen(type) + 1, &match, 1, 0)) {
cb_get_kv(match, &result, sizeof(result));
switch (result) {
case 0:
case 1:
@ -399,10 +399,10 @@ static int tolua_region_set_resource(lua_State * L)
const char *type = tolua_tostring(L, 2, 0);
int result, value = (int)tolua_tonumber(L, 3, 0);
critbit_tree * cb = special_resources();
void * matches;
void * match;
if (cb_find_prefix(cb, type, strlen(type) + 1, &matches, 1, 0)) {
cb_get_kv(matches, &result, sizeof(result));
if (cb_find_prefix(cb, type, strlen(type) + 1, &match, 1, 0)) {
cb_get_kv(match, &result, sizeof(result));
switch (result) {
case 0:
case 1:

View File

@ -384,11 +384,11 @@ const potion_type *resource2potion(const resource_type * rtype)
resource_type *rt_find(const char *name)
{
void * matches;
void * match;
resource_type *result = 0;
if (cb_find_prefix(&cb_resources, name, strlen(name) + 1, &matches, 1, 0)) {
cb_get_kv(matches, &result, sizeof(result));
if (cb_find_prefix(&cb_resources, name, strlen(name) + 1, &match, 1, 0)) {
cb_get_kv(match, &result, sizeof(result));
}
return result;
}