tSpecific checks for Antique mode removed for the Gun Shop and Pub; instead, th… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 6838179a5b3e97499b556fd92920815dda89a343 | |
parent a32c32a73c2a110368b30d87880d92e4cc833b1d | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 12 Aug 2002 11:39:08 +0000 | |
Specific checks for Antique mode removed for the Gun Shop and Pub; instead, | |
tthese two locations are explicitly removed from the game. Antique mode should | |
now use the proper number of locations (6). | |
Diffstat: | |
M src/dopewars.c | 28 ++++++++++++++++++++-------- | |
M src/gui_client/gtk_client.c | 6 ++++++ | |
M src/serverside.c | 7 +++---- | |
3 files changed, 29 insertions(+), 12 deletions(-) | |
--- | |
diff --git a/src/dopewars.c b/src/dopewars.c | |
t@@ -100,9 +100,7 @@ int NumLocation = 0, NumGun = 0, NumCop = 0, NumDrug = 0, … | |
int NumPlaying = 0, NumStoppedTo = 0; | |
int DebtInterest = 10, BankInterest = 5; | |
Player Noone; | |
-int LoanSharkLoc = DEFLOANSHARK, BankLoc = DEFBANK, GunShopLoc = | |
- DEFGUNSHOP; | |
-int RoughPubLoc = DEFROUGHPUB; | |
+int LoanSharkLoc, BankLoc, GunShopLoc, RoughPubLoc; | |
int DrugSortMethod = DS_ATOZ; | |
int FightTimeout = 5, IdleTimeout = 14400, ConnectTimeout = 300; | |
int MaxClients = 20, AITurnPause = 5; | |
t@@ -2359,15 +2357,14 @@ gchar *GetLocalConfigFile(void) | |
* hard-coded internal values, and then processes the global and | |
* user-specific configuration files. | |
*/ | |
-static void SetupParameters(GSList *extraconfigs) | |
+static void SetupParameters(GSList *extraconfigs, gboolean antique) | |
{ | |
gchar *conf; | |
GSList *list; | |
- int i; | |
+ int i, defloc; | |
DrugValue = TRUE; | |
Sanitized = ConfigVerbose = FALSE; | |
- Server = Client = Network = FALSE; | |
g_free(Currency.Symbol); | |
/* The currency symbol */ | |
t@@ -2387,6 +2384,15 @@ static void SetupParameters(GSList *extraconfigs) | |
g_free(WebBrowser); | |
WebBrowser = g_strdup("/usr/bin/mozilla"); | |
+ LoanSharkLoc = DEFLOANSHARK; | |
+ BankLoc = DEFBANK; | |
+ if (antique) { | |
+ GunShopLoc = RoughPubLoc = 0; | |
+ } else { | |
+ GunShopLoc = DEFGUNSHOP; | |
+ RoughPubLoc = DEFROUGHPUB; | |
+ } | |
+ | |
CopyNames(&Names, &DefaultNames); | |
CopyDrugs(&Drugs, &DefaultDrugs); | |
t@@ -2405,7 +2411,12 @@ static void SetupParameters(GSList *extraconfigs) | |
UseSocks = FALSE; | |
#endif | |
- ResizeLocations(sizeof(DefaultLocation) / sizeof(DefaultLocation[0])); | |
+ defloc = sizeof(DefaultLocation) / sizeof(DefaultLocation[0]); | |
+ g_assert(defloc >= 6); | |
+ if (antique) { | |
+ defloc = 6; | |
+ } | |
+ ResizeLocations(defloc); | |
for (i = 0; i < NumLocation; i++) | |
CopyLocation(&Location[i], &DefaultLocation[i]); | |
ResizeCops(sizeof(DefaultCop) / sizeof(DefaultCop[0])); | |
t@@ -2726,6 +2737,7 @@ struct CMDLINE *GeneralStartup(int argc, char *argv[]) | |
Log.Timestamp = g_strdup("[%H:%M:%S] "); | |
srand((unsigned)time(NULL)); | |
Noone.Name = g_strdup("Noone"); | |
+ Server = Client = Network = FALSE; | |
return ParseCmdLine(argc, argv); | |
} | |
t@@ -2733,7 +2745,7 @@ struct CMDLINE *GeneralStartup(int argc, char *argv[]) | |
void InitConfiguration(struct CMDLINE *cmdline) | |
{ | |
ConfigErrors = 0; | |
- SetupParameters(cmdline->configs); | |
+ SetupParameters(cmdline->configs, cmdline->antique); | |
if (cmdline->scorefile) { | |
AssignName(&HiScoreFile, cmdline->scorefile); | |
diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c | |
t@@ -72,6 +72,7 @@ struct ClientDataStruct { | |
struct InventoryWidgets Drug, Gun, InvenDrug, InvenGun; | |
GtkWidget *JetButton, *vbox, *PlayerList, *TalkList; | |
guint JetAccel; | |
+ struct CMDLINE *cmdline; | |
}; | |
struct DealDiaStruct { | |
t@@ -1916,6 +1917,10 @@ void GuiStartGame(void) | |
{ | |
Player *Play = ClientData.Play; | |
+ if (!Network) { | |
+ ClientData.cmdline->antique = WantAntique; | |
+ InitConfiguration(ClientData.cmdline); | |
+ } | |
StripTerminators(GetPlayerName(Play)); | |
InitAbilities(Play); | |
SendAbilities(Play); | |
t@@ -2165,6 +2170,7 @@ gboolean GtkLoop(int *argc, char **argv[], | |
WantUTF8Errors(TRUE); | |
#endif | |
InitConfiguration(cmdline); | |
+ ClientData.cmdline = cmdline; | |
/* Set up message handlers */ | |
ClientMessageHandlerPt = HandleClientMessage; | |
diff --git a/src/serverside.c b/src/serverside.c | |
t@@ -2337,8 +2337,7 @@ void SendEvent(Player *To) | |
} | |
break; | |
case E_GUNSHOP: | |
- if (To->IsAt + 1 == GunShopLoc && !Sanitized && NumGun > 0 | |
- && !WantAntique) { | |
+ if (To->IsAt + 1 == GunShopLoc && !Sanitized && NumGun > 0) { | |
text = dpg_strdup_printf(_("YN^Would you like to visit %tde?"), | |
Names.GunShopName); | |
SendQuestion(NULL, C_ASKGUNSHOP, To, text); | |
t@@ -2347,7 +2346,7 @@ void SendEvent(Player *To) | |
} | |
break; | |
case E_ROUGHPUB: | |
- if (To->IsAt + 1 == RoughPubLoc && !WantAntique) { | |
+ if (To->IsAt + 1 == RoughPubLoc) { | |
text = dpg_strdup_printf(_("YN^Would you like to visit %tde?"), | |
Names.RoughPubName); | |
SendQuestion(NULL, C_ASKPUB, To, text); | |
t@@ -2356,7 +2355,7 @@ void SendEvent(Player *To) | |
} | |
break; | |
case E_HIREBITCH: | |
- if (To->IsAt + 1 == RoughPubLoc && !WantAntique) { | |
+ if (To->IsAt + 1 == RoughPubLoc) { | |
To->Bitches.Price = prandom(Bitch.MinPrice, Bitch.MaxPrice); | |
text = | |
dpg_strdup_printf(_ |