Author: sveinung Date: Thu Feb 26 15:15:34 2015 New Revision: 28323 URL: http://svn.gna.org/viewcvs/freeciv?rev=28323&view=rev Log: Don't allow a (buggy) client to set a unit's activity to ACTIVITY_GOTO.
Setting ACTIVITY_GOTO from the client results in a unit indicating it is going somewhere while it is standing still. The appearance of the unit doing something can trick the user to not make use of it. See patch #5864 Modified: branches/S2_6/server/unithand.c Modified: branches/S2_6/server/unithand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/unithand.c?rev=28323&r1=28322&r2=28323&view=diff ============================================================================== --- branches/S2_6/server/unithand.c (original) +++ branches/S2_6/server/unithand.c Thu Feb 26 15:15:34 2015 @@ -1419,6 +1419,17 @@ punit->ai_controlled = FALSE; punit->goto_tile = NULL; + + if (activity == ACTIVITY_GOTO) { + /* Don't permit a client to set a unit's activity to ACTIVITY_GOTO. + * Setting ACTIVITY_GOTO from the client results in a unit indicating + * it is going somewhere while it is standing still. The appearance of + * the unit doing something can trick the user to not make use of it. + * + * Handled here because adv_follow_path() uses unit_activity_handling() + * to set a unit's activity to ACTIVITY_GOTO. */ + return; + } if (activity == ACTIVITY_EXPLORE) { unit_activity_handling_targeted(punit, activity, &activity_target); @@ -2896,9 +2907,9 @@ case ACTIVITY_FORTIFYING: case ACTIVITY_CONVERT: case ACTIVITY_EXPLORE: + case ACTIVITY_IDLE: + /* Not set from the client. */ case ACTIVITY_GOTO: - case ACTIVITY_IDLE: - /* Allowing this to be set from the client would be cheating. */ case ACTIVITY_FORTIFIED: /* Compatiblity, used in savegames. */ case ACTIVITY_OLD_ROAD: _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits