v0.13.7
errors and warnings / manifest

errors and warnings / manifest / W4031

W4031 warning

Packager @retail@ blocks left as written in a multi-version build

area
manifest (x4xxx)
fails the build
with --deny-warnings

A Lua or XML file of a converted packager project (compat.packager-keywords) has a --@retail@ (or --@non-retail@) block, and the build covers several flavors. Like the BigWigs packager in a multi-version build, wowlua leaves the block as written, so the code in a --@retail@ block runs on every client, not only on Retail.

Check the game at run time with WOW_PROJECT_ID. A project that releases one game at a time can set compat.per-game, which applies the blocks per flavor.

Example

× failswowlua.jsonjson
{    "package": {        "name": "playground",        "version": "0.1.0",        "wowlua": "^0.13"    },    "flavors": {        "camelot": {},        "vanilla": {}    },    "compat": {        "packager-keywords": true    }}
src/main.lualua
--@retail@print("Retail only")--@end-retail@
✓ compileswowlua.jsonjson
{    "package": {        "name": "playground",        "version": "0.1.0",        "wowlua": "^0.13"    },    "flavors": {        "camelot": {},        "vanilla": {}    },    "compat": {        "packager-keywords": true    }}
src/main.lualua
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then    print("Retail only")end

The compiler reports it like this:

warning[W4031]: `@retail@` blocks are left as written in a multi-version build, like the packager does
 = in src/main.lua
 = help: the code runs on every client; use Lua conditions on `WOW_PROJECT_ID` to limit it
codemessage
E4335Packager @version-…@ blocks in a multi-version build
W4030Unsupported packager keyword

Offline

terminal
$ wowlua explain W4031
W4031 (warning): Packager @retail@ blocks left as written in a multi-version build

source on GitHub ↗