Removed some ugly, unnecessary goto's

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2179 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2006-01-13 22:23:43 +00:00
parent 3b9f735153
commit f456516f36
18 changed files with 32 additions and 85 deletions
+2 -4
View File
@@ -639,7 +639,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
else if (!GET_GAME_STATE (MET_ARILOU)) else if (!GET_GAME_STATE (MET_ARILOU))
{ {
@@ -660,7 +660,7 @@ Intro (void)
Response (happy_by_hello, RespFunc); Response (happy_by_hello, RespFunc);
Response (miffed_by_hello, RespFunc); Response (miffed_by_hello, RespFunc);
SET_GAME_STATE (MET_ARILOU, 1); SET_GAME_STATE (MET_ARILOU, 1);
goto ExitIntro; return;
} }
Manner = GET_GAME_STATE (ARILOU_MANNER); Manner = GET_GAME_STATE (ARILOU_MANNER);
@@ -782,8 +782,6 @@ Intro (void)
ArilouHome ((RESPONSE_REF)0); ArilouHome ((RESPONSE_REF)0);
} }
} }
ExitIntro:
;
} }
static COUNT static COUNT
+2 -4
View File
@@ -442,7 +442,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (KOHR_AH_KILLED_ALL)) if (GET_GAME_STATE (KOHR_AH_KILLED_ALL))
@@ -450,7 +450,7 @@ Intro (void)
NPCPhrase (GAME_OVER_DUDE); NPCPhrase (GAME_OVER_DUDE);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (!GET_GAME_STATE (KOHR_AH_SENSES_EVIL) if (!GET_GAME_STATE (KOHR_AH_SENSES_EVIL)
@@ -524,8 +524,6 @@ Intro (void)
} }
SET_GAME_STATE (KOHR_AH_VISITS, NumVisits); SET_GAME_STATE (KOHR_AH_VISITS, NumVisits);
} }
ExitIntro:
;
} }
static COUNT static COUNT
+1 -3
View File
@@ -689,7 +689,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (DRUUGE_MANNER)) if (GET_GAME_STATE (DRUUGE_MANNER))
@@ -873,8 +873,6 @@ Intro (void)
Space ((RESPONSE_REF)0); Space ((RESPONSE_REF)0);
} }
} }
ExitIntro:
;
} }
static COUNT static COUNT
+3 -8
View File
@@ -505,21 +505,18 @@ OrzNeutral (RESPONSE_REF R)
else if (PLAYER_SAID (R, where_androsyn)) else if (PLAYER_SAID (R, where_androsyn))
{ {
WhereAndrosyn (R); WhereAndrosyn (R);
return;
goto ExitNeutral;
} }
else if (PLAYER_SAID (R, talk_about_alliance) else if (PLAYER_SAID (R, talk_about_alliance)
|| PLAYER_SAID (R, seem_like_nice_guys)) || PLAYER_SAID (R, seem_like_nice_guys))
{ {
OfferAlliance (R); OfferAlliance (R);
return;
goto ExitNeutral;
} }
else if (PLAYER_SAID (R, hostile_2)) else if (PLAYER_SAID (R, hostile_2))
{ {
ExitConversation (R); ExitConversation (R);
return;
goto ExitNeutral;
} }
if (GET_GAME_STATE (ORZ_ANDRO_STATE) == 0) if (GET_GAME_STATE (ORZ_ANDRO_STATE) == 0)
@@ -569,8 +566,6 @@ OrzNeutral (RESPONSE_REF R)
} }
} }
Response (bye_neutral, ExitConversation); Response (bye_neutral, ExitConversation);
ExitNeutral:
;
} }
static void static void
+1 -3
View File
@@ -849,7 +849,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
Manner = GET_GAME_STATE (PKUNK_MANNER); Manner = GET_GAME_STATE (PKUNK_MANNER);
@@ -1085,8 +1085,6 @@ Intro (void)
PkunkMigrate ((RESPONSE_REF)0); PkunkMigrate ((RESPONSE_REF)0);
} }
ExitIntro:
;
} }
// Called after combat or communications // Called after combat or communications
+1 -3
View File
@@ -546,7 +546,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
GetShofixtiName (); GetShofixtiName ();
@@ -616,8 +616,6 @@ Intro (void)
Hostile ((RESPONSE_REF)0); Hostile ((RESPONSE_REF)0);
} }
ExitIntro:
;
} }
static COUNT static COUNT
+2 -6
View File
@@ -548,7 +548,7 @@ ProbeInfo (RESPONSE_REF R)
else if (PLAYER_SAID (R, talk_more_probe_attack)) else if (PLAYER_SAID (R, talk_more_probe_attack))
{ {
ProbeFunction (R); ProbeFunction (R);
goto ExitProbeInfo; return;
} }
else if (PLAYER_SAID (R, where_probes_from)) else if (PLAYER_SAID (R, where_probes_from))
{ {
@@ -641,8 +641,6 @@ ProbeInfo (RESPONSE_REF R)
{ {
DISABLE_PHRASE (know_more_probe); DISABLE_PHRASE (know_more_probe);
} }
ExitProbeInfo:
;
} }
static void static void
@@ -728,7 +726,7 @@ HomeWorld (RESPONSE_REF R)
else if (PLAYER_SAID (R, like_more_about_you)) else if (PLAYER_SAID (R, like_more_about_you))
{ {
SlylandroInfo (R); SlylandroInfo (R);
goto ExitHomeWorld; return;
} }
else if (PLAYER_SAID (R, enough_about_me)) else if (PLAYER_SAID (R, enough_about_me))
NPCPhrase (OK_ENOUGH_YOU); NPCPhrase (OK_ENOUGH_YOU);
@@ -845,8 +843,6 @@ HomeWorld (RESPONSE_REF R)
} }
} }
Response (bye, ExitConversation); Response (bye, ExitConversation);
ExitHomeWorld:
;
} }
static void static void
+1 -3
View File
@@ -727,7 +727,7 @@ SpathiParty (RESPONSE_REF R)
Response (fellowship, SpathiParty); Response (fellowship, SpathiParty);
Response (do_as_we_say, ExitConversation); Response (do_as_we_say, ExitConversation);
goto ExitParty; return;
} }
switch (GET_GAME_STATE (SPATHI_HOME_VISITS) - 1) switch (GET_GAME_STATE (SPATHI_HOME_VISITS) - 1)
{ {
@@ -741,8 +741,6 @@ SpathiParty (RESPONSE_REF R)
Response (bye_from_party_3, ExitConversation); Response (bye_from_party_3, ExitConversation);
break; break;
} }
ExitParty:
;
} }
static void static void
+2 -6
View File
@@ -377,7 +377,7 @@ NeutralSupox (RESPONSE_REF R)
Response (what_do_i_do_now, ExitConversation); Response (what_do_i_do_now, ExitConversation);
Response (thanks_now_we_eat_you, ExitConversation); Response (thanks_now_we_eat_you, ExitConversation);
goto ExitSupox; return;
} }
else if (PLAYER_SAID (R, got_fixed_ultron)) else if (PLAYER_SAID (R, got_fixed_ultron))
{ {
@@ -515,8 +515,6 @@ NeutralSupox (RESPONSE_REF R)
} }
} }
Response (bye_neutral, ExitConversation); Response (bye_neutral, ExitConversation);
ExitSupox:
;
} }
static void static void
@@ -529,7 +527,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (SUPOX_HOSTILE)) if (GET_GAME_STATE (SUPOX_HOSTILE))
@@ -663,8 +661,6 @@ Intro (void)
NeutralSupox ((RESPONSE_REF)0); NeutralSupox ((RESPONSE_REF)0);
} }
ExitIntro:
;
} }
static COUNT static COUNT
+2 -6
View File
@@ -555,7 +555,7 @@ NormalSyreen (RESPONSE_REF R)
SET_GAME_STATE (SYREEN_KNOW_ABOUT_MYCON, 1); SET_GAME_STATE (SYREEN_KNOW_ABOUT_MYCON, 1);
SyreenShuttle ((RESPONSE_REF)0); SyreenShuttle ((RESPONSE_REF)0);
goto ExitSyreen; return;
} }
if (GET_GAME_STATE (KNOW_ABOUT_SHATTERED) < 3) if (GET_GAME_STATE (KNOW_ABOUT_SHATTERED) < 3)
@@ -629,8 +629,6 @@ NormalSyreen (RESPONSE_REF R)
Response (pStr[i], NormalSyreen); Response (pStr[i], NormalSyreen);
} }
Response (bye, FriendlyExit); Response (bye, FriendlyExit);
ExitSyreen:
;
} }
static void static void
@@ -724,7 +722,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
NumVisits = GET_GAME_STATE (SYREEN_HOME_VISITS); NumVisits = GET_GAME_STATE (SYREEN_HOME_VISITS);
@@ -832,8 +830,6 @@ Intro (void)
SyreenVault ((RESPONSE_REF)0); SyreenVault ((RESPONSE_REF)0);
} }
SET_GAME_STATE (SYREEN_HOME_VISITS, NumVisits); SET_GAME_STATE (SYREEN_HOME_VISITS, NumVisits);
ExitIntro:
;
} }
static COUNT static COUNT
+2 -6
View File
@@ -497,7 +497,7 @@ CompelPlayer (RESPONSE_REF R)
SET_GAME_STATE (BATTLE_SEGUE, 1); SET_GAME_STATE (BATTLE_SEGUE, 1);
} }
goto ExitCompel; return;
} }
if (PHRASE_ENABLED (what_are_you)) if (PHRASE_ENABLED (what_are_you))
@@ -543,8 +543,6 @@ CompelPlayer (RESPONSE_REF R)
} }
} }
Response (bye_at_umgah, CompelPlayer); Response (bye_at_umgah, CompelPlayer);
ExitCompel:
;
} }
static void PetDeal (RESPONSE_REF R); static void PetDeal (RESPONSE_REF R);
@@ -649,7 +647,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE) if (LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE)
@@ -778,8 +776,6 @@ Intro (void)
PetDeal ((RESPONSE_REF)0); PetDeal ((RESPONSE_REF)0);
} }
ExitIntro:
;
} }
static COUNT static COUNT
+1 -3
View File
@@ -693,7 +693,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (AQUA_HELIX)) if (GET_GAME_STATE (AQUA_HELIX))
@@ -904,8 +904,6 @@ Intro (void)
ThraddHostile ((RESPONSE_REF)0); ThraddHostile ((RESPONSE_REF)0);
} }
} }
ExitIntro:
;
} }
static COUNT static COUNT
+2 -4
View File
@@ -341,7 +341,7 @@ Zombies (RESPONSE_REF R)
NPCPhrase (NOT_GIVE_UP); NPCPhrase (NOT_GIVE_UP);
SET_GAME_STATE (BATTLE_SEGUE, 1); SET_GAME_STATE (BATTLE_SEGUE, 1);
goto ExitZombies; return;
} }
else if (PLAYER_SAID (R, arilou_told_us)) else if (PLAYER_SAID (R, arilou_told_us))
{ {
@@ -350,7 +350,7 @@ Zombies (RESPONSE_REF R)
SET_GAME_STATE (BATTLE_SEGUE, 1); SET_GAME_STATE (BATTLE_SEGUE, 1);
SET_GAME_STATE (KNOW_UMGAH_ZOMBIES, 1); SET_GAME_STATE (KNOW_UMGAH_ZOMBIES, 1);
SET_GAME_STATE (UMGAH_VISITS, 0); SET_GAME_STATE (UMGAH_VISITS, 0);
goto ExitZombies; return;
} }
if (PHRASE_ENABLED (evil_blobbies)) if (PHRASE_ENABLED (evil_blobbies))
@@ -402,8 +402,6 @@ Zombies (RESPONSE_REF R)
} }
} }
Response (bye_zombie, CombatIsInevitable); Response (bye_zombie, CombatIsInevitable);
ExitZombies:
;
} }
} }
+2 -4
View File
@@ -410,7 +410,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
b0 = GET_GAME_STATE (URQUAN_PROBE_GRPOFFS0); b0 = GET_GAME_STATE (URQUAN_PROBE_GRPOFFS0);
@@ -454,7 +454,7 @@ Intro (void)
NPCPhrase (CAUGHT_YA); NPCPhrase (CAUGHT_YA);
SET_GAME_STATE (BATTLE_SEGUE, 1); SET_GAME_STATE (BATTLE_SEGUE, 1);
goto ExitIntro; return;
} }
b0 = GET_GAME_STATE (SAMATRA_GRPOFFS0); b0 = GET_GAME_STATE (SAMATRA_GRPOFFS0);
@@ -517,8 +517,6 @@ Intro (void)
SET_GAME_STATE (URQUAN_VISITS, NumVisits); SET_GAME_STATE (URQUAN_VISITS, NumVisits);
} }
} }
ExitIntro:
;
} }
static COUNT static COUNT
+4 -10
View File
@@ -498,14 +498,14 @@ NeutralUtwig (RESPONSE_REF R)
SET_GAME_STATE (UTWIG_HOME_VISITS, 0); SET_GAME_STATE (UTWIG_HOME_VISITS, 0);
SET_GAME_STATE (UTWIG_VISITS, 0); SET_GAME_STATE (UTWIG_VISITS, 0);
SET_GAME_STATE (BOMB_VISITS, 0); SET_GAME_STATE (BOMB_VISITS, 0);
goto ExitUtwig; return;
} }
else if (PLAYER_SAID (R, real_sorry_about_ultron)) else if (PLAYER_SAID (R, real_sorry_about_ultron))
{ {
NPCPhrase (APPRECIATE_SYMPATHY); NPCPhrase (APPRECIATE_SYMPATHY);
SET_GAME_STATE (UTWIG_STACK1, 4); SET_GAME_STATE (UTWIG_STACK1, 4);
goto ExitUtwig; return;
} }
else if (PLAYER_SAID (R, what_about_you_1)) else if (PLAYER_SAID (R, what_about_you_1))
{ {
@@ -613,8 +613,6 @@ NeutralUtwig (RESPONSE_REF R)
if (GET_GAME_STATE (ULTRON_CONDITION)) if (GET_GAME_STATE (ULTRON_CONDITION))
Response (got_ultron, ExitConversation); Response (got_ultron, ExitConversation);
Response (bye_neutral, ExitConversation); Response (bye_neutral, ExitConversation);
ExitUtwig:
;
} }
static void static void
@@ -653,7 +651,7 @@ BombWorld (RESPONSE_REF R)
SET_GAME_STATE (UTWIG_HOME_VISITS, 0); SET_GAME_STATE (UTWIG_HOME_VISITS, 0);
SET_GAME_STATE (UTWIG_VISITS, 0); SET_GAME_STATE (UTWIG_VISITS, 0);
SET_GAME_STATE (BOMB_VISITS, 0); SET_GAME_STATE (BOMB_VISITS, 0);
goto ExitBomb; return;
} }
else if (PLAYER_SAID (R, may_we_have_bomb)) else if (PLAYER_SAID (R, may_we_have_bomb))
{ {
@@ -720,8 +718,6 @@ BombWorld (RESPONSE_REF R)
&& !GET_GAME_STATE (REFUSED_ULTRON_AT_BOMB)) && !GET_GAME_STATE (REFUSED_ULTRON_AT_BOMB))
Response (got_ultron, ExitConversation); Response (got_ultron, ExitConversation);
Response (bye_bomb, ExitConversation); Response (bye_bomb, ExitConversation);
ExitBomb:
;
} }
static void static void
@@ -734,7 +730,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (UTWIG_HOSTILE)) if (GET_GAME_STATE (UTWIG_HOSTILE))
@@ -932,8 +928,6 @@ Intro (void)
NeutralUtwig ((RESPONSE_REF)0); NeutralUtwig ((RESPONSE_REF)0);
} }
ExitIntro:
;
} }
static COUNT static COUNT
+1 -3
View File
@@ -691,7 +691,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6)) if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6))
@@ -747,8 +747,6 @@ Intro (void)
NormalVux ((RESPONSE_REF)0); NormalVux ((RESPONSE_REF)0);
} }
ExitIntro:
;
} }
static COUNT static COUNT
+2 -6
View File
@@ -437,7 +437,7 @@ YehatSpace (RESPONSE_REF R)
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
SET_GAME_STATE (NO_YEHAT_ALLY_SPACE, 2); SET_GAME_STATE (NO_YEHAT_ALLY_SPACE, 2);
goto ExitYehat; return;
} }
else if (PLAYER_SAID (R, at_least_help_us_space)) else if (PLAYER_SAID (R, at_least_help_us_space))
{ {
@@ -550,8 +550,6 @@ YehatSpace (RESPONSE_REF R)
} }
} }
Response (bye_space, ExitConversation); Response (bye_space, ExitConversation);
ExitYehat:
;
} }
static void static void
@@ -564,7 +562,7 @@ Intro (void)
NPCPhrase (OUT_TAKES); NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (YEHAT_CIVIL_WAR)) if (GET_GAME_STATE (YEHAT_CIVIL_WAR))
@@ -642,8 +640,6 @@ Intro (void)
YehatSpace ((RESPONSE_REF)0); YehatSpace ((RESPONSE_REF)0);
} }
ExitIntro:
;
} }
static COUNT static COUNT
+1 -3
View File
@@ -763,7 +763,7 @@ Intro (void)
NPCPhrase_cb (OUT_TAKES13, &SelectAlienPIK); NPCPhrase_cb (OUT_TAKES13, &SelectAlienPIK);
ZFPTalkSegue ((COUNT)~0); ZFPTalkSegue ((COUNT)~0);
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro; return;
} }
if (GET_GAME_STATE (ZOQFOT_HOSTILE)) if (GET_GAME_STATE (ZOQFOT_HOSTILE))
@@ -918,8 +918,6 @@ Intro (void)
ZoqFotHome (0); ZoqFotHome (0);
} }
ExitIntro:
;
} }
static COUNT static COUNT