Author: sveinung Date: Fri Mar 17 13:02:54 2017 New Revision: 35125 URL: http://svn.gna.org/viewcvs/freeciv?rev=35125&view=rev Log: Load action enabler action by action rule name.
Use the action's rule name. Stop assuming that action rule names will remain hard coded. See hrm Feature #645313 Modified: branches/S3_0/server/ruleset.c Modified: branches/S3_0/server/ruleset.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/server/ruleset.c?rev=35125&r1=35124&r2=35125&view=diff ============================================================================== --- branches/S3_0/server/ruleset.c (original) +++ branches/S3_0/server/ruleset.c Fri Mar 17 13:02:54 2017 @@ -6248,7 +6248,7 @@ section_list_iterate(sec, psection) { struct action_enabler *enabler; const char *sec_name = section_name(psection); - enum gen_action action; + struct action *paction; struct requirement_vector *actor_reqs; struct requirement_vector *target_reqs; const char *action_text; @@ -6264,15 +6264,15 @@ break; } - action = gen_action_by_name(action_text, fc_strcasecmp); - if (!action_id_exists(action)) { + paction = action_by_rule_name(action_text); + if (!paction) { ruleset_error(LOG_ERROR, "\"%s\" [%s] lists unknown action type \"%s\".", filename, sec_name, action_text); ok = FALSE; break; } - enabler->action = action; + enabler->action = paction->id; actor_reqs = lookup_req_list(file, compat, sec_name, "actor_reqs", action_text); if (actor_reqs == NULL) { _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits