Skip to content

Commit

Permalink
Revert "Merge branch 'WarningResolutions' of git://github.com/AkrionX…
Browse files Browse the repository at this point in the history
…xarr/Cataclysm-DDA"

This reverts commit b8b08ba, reversing
changes made to d5152fd.

Justification: Apparently, Whales used represented certain states using negative values in the inventory
system, and perhaps in other instances. This branch replaced a bunch of
ints with unsigned ints, for no real reason.

I think that this also causes the initial NPC's needs vector to become
corrupted.

Conflicts:
	bionics.cpp
	game.cpp
	graffiti.cpp
	map.cpp
	overmap.cpp
	rng.cpp
  • Loading branch information
zpmorgan committed Mar 3, 2013
1 parent a5b4dfb commit dfa7385
Show file tree
Hide file tree
Showing 69 changed files with 995 additions and 1,215 deletions.
5 changes: 2 additions & 3 deletions Makefile.Windows
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# WARNINGS will spam hundreds of warnings, mostly safe, if turned on
# DEBUG is best turned on if you plan to debug in gdb -- please do!
# PROFILE is for use with gprof or a similar program -- don't bother generally

WARNINGS = -Wall -Wextra
#WARNINGS = -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-char-subscripts
DEBUG = -g
#PROFILE = -pg
OTHERS = -O3
Expand Down Expand Up @@ -50,4 +49,4 @@ $(ODIR)/%.o: %.cpp
clean:
rm -f $(TARGET) $(ODIR)/*.o

-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
6 changes: 0 additions & 6 deletions action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ std::string action_ident(action_id act)
return "debug_mode";
case ACTION_NULL:
return "null";

default:
break;
}
return "unknown";
}
Expand Down Expand Up @@ -392,9 +389,6 @@ std::string action_name(action_id act)
return "Toggle Debug Messages";
case ACTION_NULL:
return "No Action";

default:
break;
}
return "Someone forgot to name an action.";
}
3 changes: 0 additions & 3 deletions addiction.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ void addict_effect(game *g, addiction &add)
g->u.stim -= 3;
}
break;

default:
break;
}
}

Expand Down
57 changes: 29 additions & 28 deletions artifact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ void game::process_artifact(item *it, player *p, bool wielded)
it_artifact_tool* tool = dynamic_cast<it_artifact_tool*>(it->type);
effects = tool->effects_carried;
if (wielded) {
for (unsigned int i = 0; i < tool->effects_wielded.size(); i++)
for (int i = 0; i < tool->effects_wielded.size(); i++)
effects.push_back(tool->effects_wielded[i]);
}
// Recharge it if necessary
Expand Down Expand Up @@ -448,16 +448,11 @@ void game::process_artifact(item *it, player *p, bool wielded)
it->charges++;
}
break;

// Unused enums added for completeness.
case ARTC_NULL:
case NUM_ARTCS:
break;
}
}
}

for (unsigned int i = 0; i < effects.size(); i++) {
for (int i = 0; i < effects.size(); i++) {
switch (effects[i]) {
case AEP_STR_UP:
p->str_cur += 4;
Expand All @@ -477,12 +472,25 @@ void game::process_artifact(item *it, player *p, bool wielded)
p->per_cur += 2;
p->int_cur += 2;
break;
case AEP_SPEED_UP: // Handled in player::current_speed()
break;

case AEP_IODINE:
if (p->radiation > 0)
p->radiation--;
break;

case AEP_SMOKE:
if (one_in(10)) {
int x = p->posx + rng(-1, 1), y = p->posy + rng(-1, 1);
if (m.add_field(this, x, y, fd_smoke, rng(1, 3)))
add_msg("The %s emits some smoke.", it->tname().c_str());
}
break;

case AEP_SNAKES:
break; // Handled in player::hit()

case AEP_EXTINGUISH:
for (int x = p->posx - 1; x <= p->posx + 1; x++) {
for (int y = p->posy - 1; y <= p->posy + 1; y++) {
Expand All @@ -506,14 +514,6 @@ void game::process_artifact(item *it, player *p, bool wielded)
p->thirst++;
break;

case AEP_SMOKE:
if (one_in(10)) {
int x = p->posx + rng(-1, 1), y = p->posy + rng(-1, 1);
if (m.add_field(this, x, y, fd_smoke, rng(1, 3)))
add_msg("The %s emits some smoke.", it->tname().c_str());
}
break;

case AEP_EVIL:
if (one_in(150)) { // Once every 15 minutes, on average
p->add_disease(DI_EVIL, 300, this);
Expand All @@ -523,6 +523,14 @@ void game::process_artifact(item *it, player *p, bool wielded)
}
break;

case AEP_SCHIZO:
break; // Handled in player::suffer()

case AEP_RADIOACTIVE:
if (one_in(4))
p->radiation++;
break;

case AEP_STR_DOWN:
p->str_cur -= 3;
break;
Expand All @@ -546,22 +554,16 @@ void game::process_artifact(item *it, player *p, bool wielded)
p->int_cur -= 2;
break;

case AEP_RADIOACTIVE:
if (one_in(4))
p->radiation++;
break;


default:
break;
case AEP_SPEED_DOWN:
break; // Handled in player::current_speed()
}
}
}

void game::add_artifact_messages(std::vector<art_effect_passive> effects)
{
int net_str = 0, net_dex = 0, net_per = 0, net_int = 0, net_speed = 0;
for (unsigned int i = 0; i < effects.size(); i++) {
for (int i = 0; i < effects.size(); i++) {
switch (effects[i]) {
case AEP_STR_UP: net_str += 4; break;
case AEP_DEX_UP: net_dex += 4; break;
Expand All @@ -583,6 +585,9 @@ void game::add_artifact_messages(std::vector<art_effect_passive> effects)
case AEP_SPEED_UP: net_speed += 20; break;
case AEP_SPEED_DOWN: net_speed -= 20; break;

case AEP_IODINE:
break; // No message

case AEP_SNAKES:
add_msg("Your skin feels slithery.");
break;
Expand Down Expand Up @@ -654,10 +659,6 @@ void game::add_artifact_messages(std::vector<art_effect_passive> effects)
case AEP_BAD_WEATHER:
add_msg("You feel storms coming.");
break;

// Unused enums added for completeness.
default:
break;
}
}

Expand Down
17 changes: 7 additions & 10 deletions bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ void player::activate_bionic(int b, game *g)
std::vector<std::string> good;
std::vector<std::string> bad;
WINDOW* w;
int dirx, diry, t, index;
int dirx, diry, t, l, index;
InputEvent input;
unsigned int l;
item tmp_item;

switch (bio.id) {

case bio_painkiller:
pkill += 6;
pain -= 2;
Expand Down Expand Up @@ -135,7 +135,7 @@ void player::activate_bionic(int b, game *g)
if (good.size() == 0 && bad.size() == 0)
mvwprintz(w, 1, 1, c_white, "No effects.");
else {
for (unsigned int line = 1; line < 39 && line <= good.size() + bad.size(); line++) {
for (int line = 1; line < 39 && line <= good.size() + bad.size(); line++) {
if (line <= bad.size())
mvwprintz(w, line, 1, c_red, bad[line - 1].c_str());
else
Expand Down Expand Up @@ -271,7 +271,7 @@ void player::activate_bionic(int b, game *g)
break;

case bio_water_extractor:
for (unsigned int i = 0; i < g->m.i_at(posx, posy).size(); i++) {
for (int i = 0; i < g->m.i_at(posx, posy).size(); i++) {
item tmp = g->m.i_at(posx, posy)[i];
if (tmp.type->id == itm_corpse && query_yn("Extract water from the %s",
tmp.tname().c_str())) {
Expand Down Expand Up @@ -309,7 +309,7 @@ void player::activate_bionic(int b, game *g)
traj = line_to(i, j, posx, posy, 0);
}
traj.insert(traj.begin(), point(i, j));
for (unsigned int k = 0; k < g->m.i_at(i, j).size(); k++) {
for (int k = 0; k < g->m.i_at(i, j).size(); k++) {
if (g->m.i_at(i, j)[k].made_of(IRON) || g->m.i_at(i, j)[k].made_of(STEEL)){
tmp_item = g->m.i_at(i, j)[k];
g->m.i_rem(i, j, k);
Expand Down Expand Up @@ -357,9 +357,6 @@ void player::activate_bionic(int b, game *g)
g->add_msg("You can't unlock that %s.", g->m.tername(dirx, diry).c_str());
break;

// Unused enums added for completeness.
default:
break;
}
}

Expand Down Expand Up @@ -390,7 +387,7 @@ bool player::install_bionics(game *g, it_bionic* type)
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
}
// Init the list of bionics
for (unsigned int i = 1; i < type->options.size(); i++) {
for (int i = 1; i < type->options.size(); i++) {
bionic_id id = type->options[i];
mvwprintz(w, i + 2, 0, (has_bionic(id) ? c_ltred : c_ltblue),
bionics[id].name.c_str());
Expand Down Expand Up @@ -460,7 +457,7 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
return false;
}

unsigned selection = 0;
int selection = 0;
InputEvent input;

do {
Expand Down
19 changes: 9 additions & 10 deletions catacurse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ WINDOW *initscr(void)
lastchar=-1;
inputdelay=-1;
std::string typeface;
char * typeface_c = NULL;
char * typeface_c;
std::ifstream fin;
fin.open("data\\FONTDATA");
if (!fin.is_open()){
MessageBox(WindowHandle, "Failed to open FONTDATA, loading defaults.",
NULL, 0);
NULL, NULL);
fontheight=16;
fontwidth=8;
} else {
Expand All @@ -278,7 +278,7 @@ fin.open("data\\FONTDATA");
fin >> fontheight;
if ((fontwidth <= 4) || (fontheight <=4)){
MessageBox(WindowHandle, "Invalid font size specified!",
NULL, 0);
NULL, NULL);
fontheight=16;
fontwidth=8;
}
Expand Down Expand Up @@ -314,7 +314,7 @@ fin.open("data\\FONTDATA");

} else {
MessageBox(WindowHandle, "Failed to load default font, using FixedSys.",
NULL, 0);
NULL, NULL);
font = CreateFont(fontheight, fontwidth, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
PROOF_QUALITY, FF_MODERN, "FixedSys"); //Create our font
Expand All @@ -324,8 +324,7 @@ fin.open("data\\FONTDATA");
SelectObject(backbuffer, font);//Load our font into the DC
// WindowCount=0;

if (typeface_c != NULL) delete typeface_c;

delete typeface_c;
mainwin = newwin((OPTIONS[OPT_VIEWPORT_Y] * 2 + 1),(55 + (OPTIONS[OPT_VIEWPORT_Y] * 2 + 1)),0,0);
return mainwin; //create the 'stdscr' window and return its ref
};
Expand Down Expand Up @@ -680,7 +679,7 @@ int start_color(void)
return SetDIBColorTable(backbuffer, 0, 16, windowsPalette);
};

int keypad(WINDOW */*faux*/, bool /*bf*/)
int keypad(WINDOW *faux, bool bf)
{
return 1;
};
Expand All @@ -693,11 +692,11 @@ int cbreak(void)
{
return 1;
};
int keypad(int /*faux*/, bool /*bf*/)
int keypad(int faux, bool bf)
{
return 1;
};
int curs_set(int /*visibility*/)
int curs_set(int visibility)
{
return 1;
};
Expand All @@ -718,7 +717,7 @@ int wattron(WINDOW *win, int attrs)
if (isBlink) win->BG += 8;
return 1;
};
int wattroff(WINDOW *win, int /*attrs*/)
int wattroff(WINDOW *win, int attrs)
{
win->FG=8; //reset to white
win->BG=0; //reset to black
Expand Down
Loading

0 comments on commit dfa7385

Please sign in to comment.