diff options
author | rubidium <rubidium@openttd.org> | 2011-11-13 20:52:39 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-13 20:52:39 +0000 |
commit | 3f7eb71b17da7840678c68953729aff156cc500b (patch) | |
tree | 5d71bc9aae9a9bc39ae15c1794f85d7e14987628 /src/ai/api/squirrel_export.awk | |
parent | b7a655bf4cafc68e14cade593e8b1aca7f04f7dd (diff) | |
download | openttd-3f7eb71b17da7840678c68953729aff156cc500b.tar.xz |
(svn r23210) -Codechange: generate the GetClassName function for the AI classes programmatically
Diffstat (limited to 'src/ai/api/squirrel_export.awk')
-rw-r--r-- | src/ai/api/squirrel_export.awk | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ai/api/squirrel_export.awk b/src/ai/api/squirrel_export.awk index 5a817f94d..4d0e4ff13 100644 --- a/src/ai/api/squirrel_export.awk +++ b/src/ai/api/squirrel_export.awk @@ -209,6 +209,9 @@ BEGIN { print "} // namespace SQConvert" print ""; + print "template <> const char *GetClassName<" cls ">() { return \"" cls "\"; }" + print ""; + # Then do the registration functions of the class. */ print "void SQ" cls "_Register(Squirrel *engine)" print "{" @@ -414,7 +417,6 @@ BEGIN { cls_param[1] = len; cls_param[2] = types; } else if (substr(funcname, 0, 1) == "_" && types != "v") { - } else if (funcname == "GetClassName" && types == ".") { } else if (is_static) { static_method_size++ static_methods[static_method_size, 0] = funcname |