Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 317326 Details for
Bug 461454
Review Request: lordsawar - Turn-based strategy game in a fantasy setting
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to fix crash
fix461454.patch (text/plain), 3.50 KB, created by
Ben Asselstine
on 2008-09-21 17:57:47 UTC
(
hide
)
Description:
patch to fix crash
Filename:
MIME Type:
Creator:
Ben Asselstine
Created:
2008-09-21 17:57:47 UTC
Size:
3.50 KB
patch
obsolete
>diff -uNrd lordsawar-0.1.1.orig/src/city.cpp lordsawar-0.1.1/src/city.cpp >--- lordsawar-0.1.1.orig/src/city.cpp 2008-09-21 13:19:17.000000000 -0400 >+++ lordsawar-0.1.1/src/city.cpp 2008-09-21 13:19:37.000000000 -0400 >@@ -671,13 +674,10 @@ > //we're an active neutral city > //check to see if we've made 5 or not. > //stop producing if we've made 5 armies in our neutral city >- Stack *s = d_owner->getStacklist()->getObjectAt(getPos()); >- if (!s) >- setActiveProductionSlot(d_active_production_slot); >- else if (s->size() < 5) >- setActiveProductionSlot(d_active_production_slot); >- else >+ if (countDefenders() >= MAX_ARMIES_PRODUCED_IN_ACTIVE_NEUTRAL_CITY) > setActiveProductionSlot(-1); >+ else >+ setActiveProductionSlot(d_active_production_slot); > } > else // start producing next army of same type > setActiveProductionSlot(d_active_production_slot); >@@ -732,4 +732,20 @@ > > return count; > } >+ >+const ArmyProdBase *City::getProductionBaseBelongingTo(const Army *army) >+{ >+ if (!army) >+ return NULL; >+ for (unsigned int i = 0; i < this->getMaxNoOfProductionBases(); i++) >+ { >+ const ArmyProdBase* armyprodbase = this->getProductionBase(i); >+ if (armyprodbase == NULL) >+ continue; >+ if (army->getArmyset() == armyprodbase->getArmyset() && >+ army->getTypeId() == armyprodbase->getTypeId()) >+ return armyprodbase; >+ } >+ return NULL; >+} > // End of file >diff -uNrd lordsawar-0.1.1.orig/src/city.h lordsawar-0.1.1/src/city.h >--- lordsawar-0.1.1.orig/src/city.h 2008-09-21 13:19:17.000000000 -0400 >+++ lordsawar-0.1.1/src/city.h 2008-09-21 13:19:42.000000000 -0400 >@@ -28,6 +28,7 @@ > #include "Location.h" > #include "Ownable.h" > #include "Renamable.h" >+#include "defs.h" > > class Player; > class Stack; >@@ -260,6 +268,7 @@ > > //! Return the army production base of the given slot. > const ArmyProdBase * getProductionBase(int slot) const; >+ const ArmyProdBase * getProductionBaseBelongingTo(const Army *army); > > //! Return the army production base this city is producing. > const ArmyProdBase *getActiveProductionBase() const; >diff -uNrd lordsawar-0.1.1.orig/src/defs.h lordsawar-0.1.1/src/defs.h >--- lordsawar-0.1.1.orig/src/defs.h 2008-09-21 13:19:17.000000000 -0400 >+++ lordsawar-0.1.1/src/defs.h 2008-09-21 13:19:33.000000000 -0400 >@@ -59,6 +59,7 @@ > const unsigned int DIPLOMACY_MIN_SCORE = 0; > const unsigned int MAX_STACK_SIZE = 8; > const unsigned int MAX_PRODUCTION_SLOTS_IN_A_CITY = 4; >+const unsigned int MAX_ARMIES_PRODUCED_IN_ACTIVE_NEUTRAL_CITY = 5; > > const unsigned int MAP_SIZE_TINY_WIDTH = 50; > const unsigned int MAP_SIZE_TINY_HEIGHT = 75; >diff -uNrd lordsawar-0.1.1.orig/src/player.cpp lordsawar-0.1.1/src/player.cpp >--- lordsawar-0.1.1.orig/src/player.cpp 2008-09-21 13:19:17.000000000 -0400 >+++ lordsawar-0.1.1/src/player.cpp 2008-09-21 13:19:48.000000000 -0400 >@@ -2980,12 +2982,16 @@ > { > Action_Produce *item = new Action_Produce(); > const Army *army = doCityProducesArmy(city); >- const ArmyProdBase *source_army = city->getActiveProductionBase(); >- if (city->getVectoring() == Vector<int>(-1, -1)) >- item->fillData(source_army, city, false); >- else >- item->fillData(source_army, city, true); >- addAction(item); >+ if (army) >+ { >+ const ArmyProdBase *source_army; >+ source_army = city->getProductionBaseBelongingTo(army); >+ if (city->getVectoring() == Vector<int>(-1, -1)) >+ item->fillData(source_army, city, false); >+ else >+ item->fillData(source_army, city, true); >+ addAction(item); >+ } > return true; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 461454
: 317326