Explorar el Código

Fixed #1181. Do not change that setProperty to setPropertyDer, it has to be as it is.
Sketchy fix for BattleAIs colliding ith their callbacks.

Michał W. Urbańczyk hace 12 años
padre
commit
6232a1b369
Se han modificado 3 ficheros con 3 adiciones y 2 borrados
  1. 1 0
      AI/BattleAI/BattleAI.cpp
  2. 1 1
      lib/CObjectHandler.cpp
  3. 1 1
      lib/CObjectHandler.h

+ 1 - 0
AI/BattleAI/BattleAI.cpp

@@ -346,6 +346,7 @@ struct PotentialTargets
 
 BattleAction CBattleAI::activeStack( const CStack * stack )
 {
+	cbc = cb; //TODO: make solid sure that AIs always use their callbacks (need to take care of event handlers too)
 	try
 	{
 		print("activeStack called for " + stack->nodeName());

+ 1 - 1
lib/CObjectHandler.cpp

@@ -1639,7 +1639,7 @@ void CGDwelling::initObj()
 	}
 }
 
-void CGDwelling::setPropertyDer(ui8 what, ui32 val)
+void CGDwelling::setProperty(ui8 what, ui32 val)
 {
 	switch (what)
 	{

+ 1 - 1
lib/CObjectHandler.h

@@ -478,7 +478,7 @@ public:
 	void onHeroVisit(const CGHeroInstance * h) const override;
 	void newTurn() const override;
 protected:
-	void setPropertyDer(ui8 what, ui32 val) override;
+	void setProperty(ui8 what, ui32 val) override;
 private:
 	void heroAcceptsCreatures(const CGHeroInstance *h, ui32 answer) const;
 	void fightOver(const CGHeroInstance *h, BattleResult *result) const;