Author: sveinung Date: Fri Mar 17 13:02:25 2017 New Revision: 35124 URL: http://svn.gna.org/viewcvs/freeciv?rev=35124&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: trunk/server/ruleset.c Modified: trunk/server/ruleset.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=35124&r1=35123&r2=35124&view=diff ============================================================================== --- trunk/server/ruleset.c (original) +++ trunk/server/ruleset.c Fri Mar 17 13:02:25 2017 @@ -6239,7 +6239,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; @@ -6255,15 +6255,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