Skip to content

Commit

Permalink
Fixed db2sql plugin forcing minimal mode
Browse files Browse the repository at this point in the history
Would turn map server into minimal mode regardless of the --db2sql option being used.

Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed Nov 15, 2013
1 parent 5b9ce29 commit cdf6dc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/map/map.c
Expand Up @@ -2912,7 +2912,7 @@ int map_addmap(const char* mapname) {
}

void map_delmapid(int id) {
ShowNotice("Removing map [ %s ] from map->list"CL_CLL"\n",map->list[id].name);
ShowNotice("Removing map [ %s ] from maplist"CL_CLL"\n",map->list[id].name);
memmove(map->list+id, map->list+id+1, sizeof(map->list[0])*(map->count-id-1));
map->count--;
}
Expand Down Expand Up @@ -5438,7 +5438,6 @@ int do_init(int argc, char *argv[])

HPM->event(HPET_PRE_INIT);

minimal = map->minimal;/* temp (perhaps make minimal a mask with options of what to load? e.g. plugin 1 does minimal |= mob_db; */
for( i = 1; i < argc ; i++ ) {
const char* arg = argv[i];

Expand Down Expand Up @@ -5481,7 +5480,7 @@ int do_init(int argc, char *argv[])
} else if( strcmp(arg, "run-once") == 0 ) { // close the map-server as soon as its done.. for testing [Celest]
runflag = CORE_ST_STOP;
} else if( strcmp(arg, "script-check") == 0 ) {
minimal = true;
map->minimal = true;
runflag = CORE_ST_STOP;
if( map->arg_next_value(arg, i, argc, true) )
scriptcheck = argv[++i];
Expand All @@ -5504,7 +5503,7 @@ int do_init(int argc, char *argv[])
}
}
}

minimal = map->minimal;/* temp (perhaps make minimal a mask with options of what to load? e.g. plugin 1 does minimal |= mob_db; */
if (!minimal) {
map->config_read(map->MAP_CONF_NAME);
CREATE(map->list,struct map_data,map->count);
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/db2sql.c
Expand Up @@ -180,7 +180,7 @@ CPCMD(db2sql) {
do_db2sql();
}
void db2sql_arg(char *param) {
torun = true;
map->minimal = torun = true;
}
HPExport void server_preinit (void) {
h_config_setting_lookup_string = GET_SYMBOL("config_setting_lookup_string");
Expand All @@ -192,9 +192,7 @@ HPExport void server_preinit (void) {
strlib = GET_SYMBOL("strlib");
iMalloc = GET_SYMBOL("iMalloc");

addArg("--db2sql",false,db2sql_arg,NULL);

map->minimal = true;
addArg("--db2sql",false,db2sql_arg,NULL);
}
HPExport void plugin_init (void) {
HPMi->addCPCommand("server:tools:db2sql",CPCMD_A(db2sql));
Expand Down

0 comments on commit cdf6dc9

Please sign in to comment.