Skip to content

Commit

Permalink
Suppress non-existent tech warning messages for techs not shared by a…
Browse files Browse the repository at this point in the history
…ll rulesets
  • Loading branch information
Lexxie9952 committed Mar 22, 2024
1 parent 0d4774f commit e6af88f
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions freeciv-web/src/main/webapp/javascript/music.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,22 @@ function evaluate_condition(obj, plr_idx)
***************************************************************************/
function eval_tech(plr_idx, val) {
if (tech_id_by_name(val) === null) {
console.log("********************************************* WARNING !!!");
console.log("music.js:eval_tech tried to evaluate non-existent tech: "+val
+", which may render song as never/always playable.");
switch(val) {
/* Suppress known cases of techs not shared by rulesets */
case "Genetic Engineering":
case "Microbiology":
case "Labor Union":
case "Mechanization":
case "Radio.2":
case "Space.2":
case "Combu.2":
case "Flight.2":
break;
default:
console.log("********************************************* WARNING !!!");
console.log("music.js:eval_tech tried to evaluate non-existent tech: "+val
+", which may render song as never/always playable.");
}
return -1;
}
return (playerno_knows_tech(plr_idx, val));
Expand Down

0 comments on commit e6af88f

Please sign in to comment.