Teaching doesn't work. I have a statesman in a university, and I can click
on "assign to teacher" on a free colonist, but nothing happens when I click
it

The attached patch fixes it, but a better fix is probably to find out why
colonies and unittypes exist in two copies.

Regards, Thue

diff --git a/src/net/sf/freecol/client/control/InGameController.java
b/src/net/sf/freecol/client/control/InGameController.java
index 371a497..5193e50 100644
--- a/src/net/sf/freecol/client/control/InGameController.java
+++ b/src/net/sf/freecol/client/control/InGameController.java
@@ -1365,7 +1365,7 @@ public final class InGameController implements
NetworkConstants {
             || !player.owns(teacher)
             || !student.canBeStudent(teacher)
             || teacher.getColony() == null
-            || student.getColony() != teacher.getColony()
+            ||
!student.getColony().getId().equals(teacher.getColony().getId())
             || !teacher.getColony().canTrain(teacher)) {
             return;
         }
diff --git a/src/net/sf/freecol/common/model/UnitType.java
b/src/net/sf/freecol/common/model/UnitType.java
index cd1d529..105b592 100644
--- a/src/net/sf/freecol/common/model/UnitType.java
+++ b/src/net/sf/freecol/common/model/UnitType.java
@@ -483,8 +483,8 @@ public final class UnitType extends BuildableType
      */
     public boolean canBeUpgraded(UnitType newType, ChangeType changeType) {
         for (UnitTypeChange change : getTypeChanges()) {
-            if ((newType == null || newType == change.getNewUnitType())
-                && change.getProbability(changeType) > 0) {
+            if ((newType == null ||
newType.getId().equals(change.getNewUnitType().getId()))
+               && change.getProbability(changeType) > 0) {
                 return true;
             }
         }
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to