summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-02-26 10:39:52 -0500
committergumi <mekolat@users.noreply.github.com>2017-02-26 12:17:01 -0500
commit567abb9c907a471b35c6aa70c8e5f47393fec4b3 (patch)
treed86814113cc839cf76e2d96c50351fe822291e6e
parent37d14b0961719c938824f2bcded967c27e3a71bc (diff)
downloadhercules-567abb9c907a471b35c6aa70c8e5f47393fec4b3.tar.gz
hercules-567abb9c907a471b35c6aa70c8e5f47393fec4b3.tar.bz2
hercules-567abb9c907a471b35c6aa70c8e5f47393fec4b3.tar.xz
hercules-567abb9c907a471b35c6aa70c8e5f47393fec4b3.zip
fix code style in script_array_src
-rw-r--r--src/map/script.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 1e839e8f1..d4243a4bd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3113,9 +3113,9 @@ void script_array_add_member(struct script_array *sa, unsigned int idx) {
**/
struct reg_db *script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
struct reg_db *src = NULL;
-
nullpo_retr(NULL, name);
- switch( name[0] ) {
+
+ switch (name[0]) {
/* from player */
default: /* char reg */
case '@':/* temp char reg */
@@ -3136,15 +3136,16 @@ struct reg_db *script_array_src(struct script_state *st, struct map_session_data
break;
case '\'':/* instance */
nullpo_retr(NULL, st);
- if( st->instance_id >= 0 ) {
+ if (st->instance_id >= 0) {
src = &instance->list[st->instance_id].regs;
}
break;
}
- if( src ) {
- if( !src->arrays )
+ if (src) {
+ if (!src->arrays) {
src->arrays = idb_alloc(DB_OPT_BASE);
+ }
return src;
}
return NULL;