summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-01-12 16:38:58 -0200
committershennetsind <ind@henn.et>2014-01-12 16:38:58 -0200
commite4c21279a33a810ee80c334a74c422affcdab870 (patch)
treea7dab158ca095f82c6814d7c903e222ba90716c6 /src/map/script.c
parentd9c1629c753ae756ce32613a76e69b3a03970b8d (diff)
parent253e90c67f7ddbbb3ab2f9f68a0d760d059ed797 (diff)
downloadhercules-e4c21279a33a810ee80c334a74c422affcdab870.tar.gz
hercules-e4c21279a33a810ee80c334a74c422affcdab870.tar.bz2
hercules-e4c21279a33a810ee80c334a74c422affcdab870.tar.xz
hercules-e4c21279a33a810ee80c334a74c422affcdab870.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 529ea7d5c..3bd6d033d 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2594,7 +2594,7 @@ void* get_val2(struct script_state* st, int64 uid, struct DBMap** ref) {
script->push_val(st->stack, C_NAME, uid, ref);
data = script_getdatatop(st, -1);
script->get_val(st, data);
- return (data->type == C_INT ? (void*)__64BPTRSIZE(data->u.num) : (void*)__64BPTRSIZE(data->u.str));
+ return (data->type == C_INT ? (void*)__64BPTRSIZE((int32)data->u.num) : (void*)__64BPTRSIZE(data->u.str)); // u.num is int32 because it comes from script->get_val
}
/**
* Because, currently, array members with key 0 are indifferenciable from normal variables, we should ensure its actually in
@@ -2837,20 +2837,20 @@ int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, co
i64db_put(n, num, aStrdup(str));
if( script_getvaridx(num) )
script->array_update(
- (name[1] == '@') ?
- &st->stack->array_function_db :
- &st->script->script_arrays_db,
- num,
- false);
+ (name[1] == '@') ?
+ &st->stack->array_function_db :
+ &st->script->script_arrays_db,
+ num,
+ false);
} else {
i64db_remove(n, num);
if( script_getvaridx(num) )
script->array_update(
- (name[1] == '@') ?
- &st->stack->array_function_db :
- &st->script->script_arrays_db,
- num,
- true);
+ (name[1] == '@') ?
+ &st->stack->array_function_db :
+ &st->script->script_arrays_db,
+ num,
+ true);
}
}
}
@@ -2908,20 +2908,20 @@ int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, co
i64db_iput(n, num, val);
if( script_getvaridx(num) )
script->array_update(
- (name[1] == '@') ?
- &st->stack->array_function_db :
- &st->script->script_arrays_db,
- num,
- false);
+ (name[1] == '@') ?
+ &st->stack->array_function_db :
+ &st->script->script_arrays_db,
+ num,
+ false);
} else {
i64db_remove(n, num);
if( script_getvaridx(num) )
script->array_update(
- (name[1] == '@') ?
- &st->stack->array_function_db :
- &st->script->script_arrays_db,
- num,
- true);
+ (name[1] == '@') ?
+ &st->stack->array_function_db :
+ &st->script->script_arrays_db,
+ num,
+ true);
}
}
}
@@ -4113,15 +4113,15 @@ void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32
* Clears persistent variables from memory
**/
int script_reg_destroy(DBKey key, DBData *data, va_list ap) {
- void *src;
+ struct script_reg_state *src;
if( data->type != DB_DATA_PTR )/* got no need for those! */
return 0;
src = DB->data2ptr(data);
- if( ((struct script_reg_state*)src)->type ) {
- struct script_reg_str *p = src;
+ if( src->type ) {
+ struct script_reg_str *p = (struct script_reg_str *)src;
if( p->value )
aFree(p->value);