Nuke as many warnings as possible, and several globals as well
- Warnings completely suppressed for the included TinyXML and gzstream libraries - Parentheses warnings are now errors, since there were several that looked like bugs - Ditto for dangling else warnings Some of these warnings were actually bugs: - Town wandering monsters would have never spawned, because the code to do so was accidentally nested within a check for overall_mode == MODE_OUTDOORS ---> boe.monster.cpp, lines 105-137 - Monster's behaviour with respect to elemental fields did not correctly depend on their immunities (this is the same precedence issue Sylae messed up fixing in the Windows code) ---> boe.monsters.cpp, lines 345-359 - Display of damage blocked by armour appeared to be incorrect (needs verification) ---> boe.newgraph.cpp, line 1079 - Three-choice dialogs probably weren't dealing with unusual button types correctly, though that's a minor point since they aren't expected to use such buttons
This commit is contained in:
@@ -1054,7 +1054,7 @@ void cDialog::run(){
|
||||
if(kb::isKeyPressed(kb::LShift)) key.mod += mod_shift;
|
||||
if(kb::isKeyPressed(kb::RShift)) key.mod += mod_shift;
|
||||
where = {currentEvent.mouseButton.x, currentEvent.mouseButton.y};
|
||||
itemHit = process_click(where, key.mod);
|
||||
itemHit = process_click(where);
|
||||
break;
|
||||
case sf::Event::MouseMoved:
|
||||
set_cursor(sword_curs);
|
||||
@@ -1065,11 +1065,13 @@ void cDialog::run(){
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: // To silence warning of unhandled enum values
|
||||
break;
|
||||
}
|
||||
if(itemHit.empty()) continue;;
|
||||
ctrlIter ctrl = controls.find(itemHit);
|
||||
// TODO: Should it do something with the boolean return value?
|
||||
if(ctrl != controls.end()) ctrl->second->triggerClickHandler(*this,itemHit,key.mod,where);
|
||||
if(ctrl != controls.end()) ctrl->second->triggerClickHandler(*this,itemHit,key.mod);
|
||||
itemHit.clear();
|
||||
}
|
||||
win.setVisible(false);
|
||||
@@ -1214,7 +1216,7 @@ std::string cDialog::process_keystroke(cKey keyHit){
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string cDialog::process_click(location where, eKeyMod mods){
|
||||
std::string cDialog::process_click(location where){
|
||||
ctrlIter iter = controls.begin();
|
||||
while(iter != controls.end()){
|
||||
if(iter->second->isVisible() && iter->second->isClickable() && where.in(iter->second->getBounds())){
|
||||
|
Reference in New Issue
Block a user