mail[Wesnoth-commits] r33859 - in /tags/1.6a: data/multiplayer/factions/ src/ src/gui/widgets/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by crazy-ivanovic on March 19, 2009 - 21:52:
Author: ivanovic
Date: Thu Mar 19 21:52:41 2009
New Revision: 33859

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33859&view=rev
Log:
merge revisions 33849, 33854, 33855, 33857 and 33858 into 1.6a to fix a 
crashes (due to an assertion failed) and problems with the AI (fixes to the 
formula stuff as well as deactivating the usage of the formula recruitment by 
default)

Modified:
    tags/1.6a/data/multiplayer/factions/drakes-aoh.cfg
    tags/1.6a/data/multiplayer/factions/drakes-default.cfg
    tags/1.6a/data/multiplayer/factions/knalgans-aoh.cfg
    tags/1.6a/data/multiplayer/factions/knalgans-default.cfg
    tags/1.6a/data/multiplayer/factions/loyalists-aoh.cfg
    tags/1.6a/data/multiplayer/factions/loyalists-default.cfg
    tags/1.6a/data/multiplayer/factions/northerners-aoh.cfg
    tags/1.6a/data/multiplayer/factions/northerners-default.cfg
    tags/1.6a/data/multiplayer/factions/rebels-aoh.cfg
    tags/1.6a/data/multiplayer/factions/rebels-default.cfg
    tags/1.6a/data/multiplayer/factions/undead-aoh.cfg
    tags/1.6a/data/multiplayer/factions/undead-default.cfg
    tags/1.6a/src/formula_ai.cpp
    tags/1.6a/src/formula_function.cpp
    tags/1.6a/src/gui/widgets/window.cpp
    tags/1.6a/src/text.cpp

Modified: tags/1.6a/data/multiplayer/factions/drakes-aoh.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/drakes-aoh.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/drakes-aoh.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/drakes-aoh.cfg Thu Mar 19 21:52:41 
2009
@@ -9,7 +9,6 @@
     random_leader=Drake Flameheart,Inferno Drake,Drake Enforcer,Drake 
Warden,Drake Blademaster
     recruit=Drake Burner,Fire Drake,Drake Clasher,Drake Glider,Drake 
Fighter,Saurian Skirmisher,Saurian Augur,Drake Warrior,Drake Flare,Drake 
Gladiator,Sky Drake,Drake Slasher,Saurian Ambusher,Saurian Soothsayer,Saurian 
Oracle
     terrain_liked=Hh, Ha, Ds, Ss
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,archer,healer,scout,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/drakes-default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/drakes-default.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/drakes-default.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/drakes-default.cfg Thu Mar 19 
21:52:41 2009
@@ -9,7 +9,6 @@
     random_leader=Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake 
Warrior
     recruit=Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian 
Skirmisher,Saurian Augur
     terrain_liked=Hh, Ha, Ds, Ss
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,archer,healer,scout,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/knalgans-aoh.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/knalgans-aoh.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/knalgans-aoh.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/knalgans-aoh.cfg Thu Mar 19 21:52:41 
2009
@@ -9,7 +9,6 @@
     random_leader=Dwarvish Lord,Dwarvish Dragonguard,Assassin,Huntsman,Ranger
     recruit=Dwarvish Guardsman,Dwarvish Stalwart,Dwarvish Fighter,Dwarvish 
Steelclad,Dwarvish Ulfserker,Dwarvish Berserker,Dwarvish Thunderer,Dwarvish 
Thunderguard,Thief,Rogue,Poacher,Trapper,Footpad,Outlaw,Gryphon Rider,Gryphon 
Master
     terrain_liked=Hh, Ha, Mm
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,fighter,mixed 
fighter,archer,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/knalgans-default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/knalgans-default.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/knalgans-default.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/knalgans-default.cfg Thu Mar 19 
21:52:41 2009
@@ -9,7 +9,6 @@
     random_leader=Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper
     recruit=Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish 
Thunderer,Thief,Poacher,Footpad,Gryphon Rider
     terrain_liked=Hh, Ha, Mm
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,fighter,mixed 
fighter,archer,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/loyalists-aoh.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/loyalists-aoh.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/loyalists-aoh.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/loyalists-aoh.cfg Thu Mar 19 21:52:41 
2009
@@ -9,7 +9,6 @@
     random_leader=General,Royal Guard,Halberdier,Master Bowman,Arch 
Mage,Silver Mage
     
recruit=Cavalryman,Dragoon,Horseman,Lancer,Knight,Spearman,Swordsman,Pikeman,Javelineer,Fencer,Duelist,Heavy
 Infantryman,Shock Trooper,Bowman,Longbowman,Mage,Red Mage,White Mage,Merman 
Fighter,Merman Warrior,Ogre,Lieutenant
     terrain_liked=Gg, Ww, Wo
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,fighter,archer,mixed 
fighter,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/loyalists-default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/loyalists-default.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/loyalists-default.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/loyalists-default.cfg Thu Mar 19 
21:52:41 2009
@@ -9,7 +9,6 @@
     random_leader=Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage
     recruit=Cavalryman,Horseman,Spearman,Fencer,Heavy 
Infantryman,Bowman,Mage,Merman Fighter
     terrain_liked=Gg, Ww, Wo
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,fighter,archer,mixed 
fighter,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/northerners-aoh.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/northerners-aoh.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/northerners-aoh.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/northerners-aoh.cfg Thu Mar 19 
21:52:41 2009
@@ -9,7 +9,6 @@
     random_leader=Orcish Warlord,Troll Warrior,Orcish Slurbow
     recruit=Orcish Grunt,Orcish Warrior,Troll Whelp,Troll,Troll 
Rocklobber,Wolf Rider,Goblin Knight,Goblin Pillager,Orcish Archer,Orcish 
Crossbowman,Orcish Assassin,Orcish Slayer,Naga Fighter,Naga Warrior,Goblin 
Spearman,Goblin Impaler,Goblin Rouser
     terrain_liked=Hh, Ha, Mm, Ss
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,fighter,mixed 
fighter,archer,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/northerners-default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/northerners-default.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/northerners-default.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/northerners-default.cfg Thu Mar 19 
21:52:41 2009
@@ -8,7 +8,6 @@
     leader=Orcish Warrior,Troll,Troll Rocklobber,Orcish Crossbowman,Orcish 
Slayer
     recruit=Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish 
Assassin,Naga Fighter,Goblin Spearman
     terrain_liked=Hh, Ha, Mm, Ss
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,fighter,mixed 
fighter,archer,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/rebels-aoh.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/rebels-aoh.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/rebels-aoh.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/rebels-aoh.cfg Thu Mar 19 21:52:41 
2009
@@ -9,7 +9,6 @@
     random_leader=Elvish Marshal,Elvish Champion,Elvish Avenger,Elvish 
Sharpshooter,Arch Mage,Silver Mage,Elvish Shyde,Elvish Enchantress
     recruit=Elvish Fighter,Elvish Hero,Elvish Captain,Elvish Archer,Elvish 
Marksman,Elvish Ranger,Mage,Red Mage,White Mage,Elvish Shaman,Elvish 
Druid,Elvish Sorceress,Elvish Scout,Elvish Rider,Wose,Elder Wose,Merman 
Hunter,Merman Spearman,Merman Netcaster
     terrain_liked=Ff, Fa, Ss, Ww
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,archer,archer,mixed 
fighter,healer,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/rebels-default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/rebels-default.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/rebels-default.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/rebels-default.cfg Thu Mar 19 
21:52:41 2009
@@ -9,7 +9,6 @@
     random_leader=Elvish Captain,Elvish Hero,Elvish Ranger,Elvish 
Marksman,Elvish Druid,Elvish Sorceress,Red Mage
     recruit=Elvish Fighter,Elvish Archer,Mage,Elvish Shaman,Elvish 
Scout,Wose,Merman Hunter
     terrain_liked=Ff, Fa, Ss, Ww
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,archer,archer,mixed 
fighter,healer,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/undead-aoh.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/undead-aoh.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/undead-aoh.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/undead-aoh.cfg Thu Mar 19 21:52:41 
2009
@@ -9,7 +9,6 @@
     random_leader=Lich,Necromancer,Draug,Banebow
     recruit=Skeleton,Revenant,Deathblade,Skeleton Archer,Bone 
Shooter,Walking Corpse,Soulless,Ghost,Wraith,Shadow,Vampire Bat,Blood 
Bat,Ghoul,Necrophage,Dark Adept,Dark Sorcerer
     terrain_liked=Ss, Hh, Ha, Ww
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,fighter,mixed 
fighter,archer,scout
         [team_formula]

Modified: tags/1.6a/data/multiplayer/factions/undead-default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/data/multiplayer/factions/undead-default.cfg?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/data/multiplayer/factions/undead-default.cfg (original)
+++ tags/1.6a/data/multiplayer/factions/undead-default.cfg Thu Mar 19 
21:52:41 2009
@@ -9,7 +9,6 @@
     random_leader=Dark Sorcerer,Revenant,Deathblade,Bone Shooter
     recruit=Skeleton,Skeleton Archer,Walking Corpse,Ghost,Vampire Bat,Dark 
Adept,Ghoul
     terrain_liked=Ss, Hh, Ha, Ww
-    ai_algorithm=formula_ai
     [ai]
         recruitment_pattern=fighter,fighter,archer,fighter,scout,archer
         [team_formula]

Modified: tags/1.6a/src/formula_ai.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/src/formula_ai.cpp?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/src/formula_ai.cpp (original)
+++ tags/1.6a/src/formula_ai.cpp Thu Mar 19 21:52:41 2009
@@ -1901,15 +1901,22 @@
                                 map_location destination = 
path_calculator(move->src(), move->dst(), unit_it);
 
                                 if( destination != map_location()) {
-                                    move_unit(move->src(), destination, 
possible_moves_);
-                                    unit_map::iterator unit = 
get_info().units.find(destination);
-                                    if(unit != get_info().units.end()) {
-                                            unit->second.set_movement(0);
+                                    map_location new_location = 
move_unit(move->src(), destination, possible_moves_);
+                                    if ( (new_location != move->src()) || 
(move->src()==move->dst()) ){
+                                        unit_map::iterator unit = 
get_info().units.find(new_location);
+
+                                        if(unit != get_info().units.end()) {
+                                                unit->second.set_movement(0);
+                                        } else {
+                                                throw 
formula_error("Incorrect result of calling the move() formula", "", "", 0);
+                                        }
+                                        
+                                        LOG_AI << "MOVE: " << move->src().x 
<< "," << move->src().y << " -> " << move->dst().x << "," << move->dst().y << 
"\n";
+                                        made_move = true;
+                                        
                                     } else {
-                                            throw formula_error("Incorrect 
result of calling the move() formula", "", "", 0);
+                                           ERR_AI << "IMPOSSIBLE MOVE ORDER 
- MOVE FAILED\n";
                                     }
-                                    LOG_AI << "MOVE: " << move->src().x << 
"," << move->src().y << " -> " << move->dst().x << "," << move->dst().y << 
"\n";
-                                    made_move = true;
                                 } else
                                     ERR_AI << "IMPOSSIBLE MOVE ORDER\n";
                        }

Modified: tags/1.6a/src/formula_function.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/src/formula_function.cpp?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/src/formula_function.cpp (original)
+++ tags/1.6a/src/formula_function.cpp Thu Mar 19 21:52:41 2009
@@ -22,6 +22,9 @@
 
 
 #define DBG_NG LOG_STREAM(debug, engine)
+#define LOG_AI LOG_STREAM(info, formula_ai)
+#define WRN_AI LOG_STREAM(warn, formula_ai)
+#define ERR_AI LOG_STREAM(err, formula_ai)
 
 namespace game_logic {
 
@@ -176,13 +179,13 @@
                if( args().size() == 1)
                {
                        str1 = var1.to_debug_string();
-                       std::cout<< str1 << std::endl;
+                       LOG_AI << str1 << std::endl;
                        return var1;
                } else {
                        str1 = var1.string_cast();
                        const variant var2 = args()[1]->evaluate(variables);
                        str2 = var2.to_debug_string();
-                       std::cout<< str1 << str2 << std::endl;
+                       LOG_AI << str1 << str2 << std::endl;
                        return var2;
                }
        }

Modified: tags/1.6a/src/gui/widgets/window.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/src/gui/widgets/window.cpp?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/src/gui/widgets/window.cpp (original)
+++ tags/1.6a/src/gui/widgets/window.cpp Thu Mar 19 21:52:41 2009
@@ -148,8 +148,8 @@
 
                game_display* display = game_display::get_singleton();
                if(display) {
-                       settings::gamemap_width = display->map_area().w;
-                       settings::gamemap_height = display->map_area().h;
+                       settings::gamemap_width = 
display->map_outside_area().w;
+                       settings::gamemap_height = 
display->map_outside_area().h;
                } else {
                        settings::gamemap_width = settings::screen_width;
                        settings::gamemap_height = settings::screen_height;

Modified: tags/1.6a/src/text.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/tags/1.6a/src/text.cpp?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- tags/1.6a/src/text.cpp (original)
+++ tags/1.6a/src/text.cpp Thu Mar 19 21:52:41 2009
@@ -226,13 +226,20 @@
 
        // Now convert this offset to a column, this way is a bit hacky but 
haven't
        // found a better solution yet.
+
+       /** 
+        * @todo There's still a bug left. When you select a text which is in 
the
+        * ellipses on the right side the text gets reformatted with ellipses 
on
+        * the left and the selected character is not the one under the 
cursor.
+        * Other widget toolkits don't show ellipses and have no indication 
more
+        * text is available. Haven't found what the best thing to do would 
be.
+        * Until that time leave it as is.
+        */
        for(size_t i = 0; ; ++i) {
                const int pos = get_cursor_position(i, line).x;
 
                if(pos == offset) {
                        return  gui2::tpoint(i, line);
-               } else if(pos == 0) {
-                       assert(i == 0);
                }
        }
 }




Related Messages


Powered by MHonArc, Updated Thu Mar 19 22:20:14 2009