From: Martin Taibr Date: Wed, 4 Sep 2019 17:25:48 +0000 (+0200) Subject: remove some easy gotos X-Git-Tag: xonotic-v0.8.5~1312^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F707%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git remove some easy gotos --- diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 7c6fcbafe..9d74477b4 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -202,12 +202,21 @@ void OnlineBanList_Think(entity this) float i, n; if(autocvar_g_ban_sync_uri == "") - goto killme; + { + delete(this); + return; + } if(autocvar_g_ban_sync_interval == 0) // < 0 is okay, it means "sync on level start only" - goto killme; + { + delete(this); + return; + } argc = tokenize_console(autocvar_g_ban_sync_trusted_servers); if(argc == 0) - goto killme; + { + delete(this); + return; + } string s = argv(0); for(i = 1; i < argc; ++i) s = strcat(s, ";", argv(i)); strcpy(OnlineBanList_Servers, s); @@ -231,14 +240,13 @@ void OnlineBanList_Think(entity this) uri_get(strcat(argv(i), "?", uri), URI_GET_IPBAN + i); // 1000 = "banlist" callback target } - if(autocvar_g_ban_sync_interval > 0) - this.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60); - else - goto killme; - return; + if(autocvar_g_ban_sync_interval <= 0) + { + delete(this); + return; + } -LABEL(killme) - delete(this); + this.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60); } const float BAN_MAX = 256; diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 6b5b19d79..54c974433 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -324,14 +324,17 @@ void SV_OnEntityPreSpawnFunction(entity this) if (this.gametypefilter != "") if (!isGametypeInFilter(MapInfo_LoadedGametype, teamplay, have_team_spawns, this.gametypefilter)) { - goto cleanup; + delete(this); + return; } if (this.cvarfilter != "" && !expr_evaluate(this.cvarfilter)) { - goto cleanup; + delete(this); + return; } if (DoesQ3ARemoveThisEntity(this)) { - goto cleanup; + delete(this); + return; } set_movetype(this, this.movetype); @@ -356,11 +359,9 @@ void SV_OnEntityPreSpawnFunction(entity this) #undef X if (MUTATOR_CALLHOOK(OnEntityPreSpawn, this)) { - goto cleanup; + delete(this); + return; } - return; -LABEL(cleanup) - delete(this); } void WarpZone_PostInitialize_Callback()