[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src replay.cpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src replay.cpp |
Date: |
Mon, 02 May 2005 16:35:23 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 05/05/02 20:35:23
Modified files:
src : replay.cpp
Log message:
Don't skip error throwing if we just tested for a NULL pointer or an
invalid iterator: it would segfault.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/replay.cpp.diff?tr1=1.111&tr2=1.112&r1=text&r2=text
Patches:
Index: wesnoth/src/replay.cpp
diff -u wesnoth/src/replay.cpp:1.111 wesnoth/src/replay.cpp:1.112
--- wesnoth/src/replay.cpp:1.111 Mon May 2 19:42:04 2005
+++ wesnoth/src/replay.cpp Mon May 2 20:35:22 2005
@@ -1,4 +1,4 @@
-/* $Id: replay.cpp,v 1.111 2005/05/02 19:42:04 silene Exp $ */
+/* $Id: replay.cpp,v 1.112 2005/05/02 20:35:22 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -565,7 +565,7 @@
if(advancing_units.empty() == false) {
if(cfg == NULL) {
ERR_NW << "promotion expected, but none
found\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
//if there is a promotion, we process it and go onto
the next command
@@ -655,7 +655,7 @@
ERR_NW << "recruitment index is illegal: " <<
val
<< " while this side only has " <<
recruits.size()
<< " units available for recruitment\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
std::set<std::string>::const_iterator itor =
recruits.begin();
@@ -663,7 +663,7 @@
const std::map<std::string,unit_type>::const_iterator
u_type = gameinfo.unit_types.find(*itor);
if(u_type == gameinfo.unit_types.end()) {
ERR_NW << "recruiting illegal unit: '" << *itor
<< "'\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
unit new_unit(&(u_type->second),team_num,true);
@@ -693,7 +693,7 @@
player_info* player =
state_of_game.get_player(current_team.save_id());
if(player == NULL) {
ERR_NW << "illegal recall\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
sort_units(player->available_units);
@@ -719,7 +719,7 @@
player_info* const player =
state_of_game.get_player(current_team.save_id());
if(player == NULL) {
ERR_NW << "illegal disband\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
sort_units(player->available_units);
@@ -741,7 +741,7 @@
if(destination == NULL || source == NULL) {
ERR_NW << "no destination/source found in
movement\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
const gamemap::location src(*source);
@@ -757,7 +757,7 @@
if(u == units.end()) {
ERR_NW << "unfound location for source of
movement: "
<< src << " -> " << dst << '\n';
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
const bool ignore_zocs =
u->second.type().is_skirmisher();
@@ -825,7 +825,7 @@
if(destination == NULL || source == NULL) {
ERR_NW << "no destination/source found in
attack\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
const gamemap::location src(*source);
@@ -837,7 +837,7 @@
std::map<gamemap::location,unit>::iterator u =
units.find(src);
if(u == units.end()) {
ERR_NW << "unfound location for source of
attack\n";
- if (!game_config::ignore_replay_errors) throw
replay::error();
+ throw replay::error();
}
if(size_t(weapon_num) >= u->second.attacks().size()) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src replay.cpp,
Guillaume Melquiond <=