summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
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);