diff --git a/src/multiint.c b/src/multiint.c index 88595719f..8ba0c1d05 100644 --- a/src/multiint.c +++ b/src/multiint.c @@ -1091,6 +1091,39 @@ static void addBlueForm(UDWORD parent,UDWORD id, const char *txt,UDWORD x,UDWORD } +typedef struct +{ + char const *stat; + char const *desc; + int icon; +} LimitIcon; +static const LimitIcon limitIcons[] = +{ + {"A0LightFactory", N_("Tanks disabled!!"), IMAGE_FRAGLIMIT}, + {"A0CyborgFactory", N_("Cyborgs disabled."), IMAGE_FRAGLIMIT}, + {"A0VTolFactory1", N_("VTOLs disabled."), IMAGE_FRAGLIMIT} +}; + +void updateLimitFlags() +{ + unsigned i; + unsigned flags = 0; + + if (!ingame.bHostSetup) + { + return; // The host works out the flags. + } + + for (i = 0; i < ARRAY_SIZE(limitIcons); ++i) + { + int stat = getStructStatFromName(limitIcons[i].stat); + bool disabled = asStructLimits[0] != NULL && stat >= 0 && asStructLimits[0][stat].limit == 0; + flags |= disabled<