From f65de3bbbbd482b1035a6600f96cb23f12510b65 Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 30 May 2012 14:13:43 +0100 Subject: [PATCH] Added GetGameTickCount native (bug 5209, r=psychonic). --- AMBuildScript | 4 ++-- core/smn_halflife.cpp | 6 ++++++ plugins/include/halflife.inc | 7 +++++++ tools/buildbot/PackageScript | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index b5e9d5a9..93a521e3 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -43,7 +43,7 @@ class SM: 'HL2SDKOBVALVE': 'hl2sdk-ob-valve', 'HL2SDKL4D': 'hl2sdk-l4d', 'HL2SDKL4D2': 'hl2sdk-l4d2', - 'MYSQL5': 'mysql-5.0' +# 'MYSQL5': 'mysql-5.0' } if AMBuild.target['platform'] != 'darwin': @@ -403,7 +403,7 @@ FileList = [ ['extensions', 'cstrike', 'AMBuilder'], ['extensions', 'curl', 'AMBuilder'], ['extensions', 'geoip', 'AMBuilder'], - ['extensions', 'mysql', 'AMBuilder'], +# ['extensions', 'mysql', 'AMBuilder'], ['extensions', 'sdktools', 'AMBuilder'], ['extensions', 'topmenus', 'AMBuilder'], ['extensions', 'updater', 'AMBuilder'], diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index 0965efda..5e6f8295 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -87,6 +87,11 @@ static cell_t GetGameTime(IPluginContext *pContext, const cell_t *params) return sp_ftoc(gpGlobals->curtime); } +static cell_t GetGameTickCount(IPluginContext *pContext, const cell_t *params) +{ + return gpGlobals->tickcount; +} + static cell_t CreateFakeClient(IPluginContext *pContext, const cell_t *params) { if (!g_SourceMod.IsMapRunning()) @@ -524,6 +529,7 @@ REGISTER_NATIVES(halflifeNatives) {"GetGameDescription", GetGameDescription}, {"GetGameFolderName", GetGameFolderName}, {"GetGameTime", GetGameTime}, + {"GetGameTickCount", GetGameTickCount}, {"GetRandomFloat", GetRandomFloat}, {"GetRandomInt", GetRandomInt}, {"IsDedicatedServer", IsDedicatedServer}, diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index 2a60bdad..12f122a2 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -128,6 +128,13 @@ native Float:GetEngineTime(); */ native Float:GetGameTime(); +/** + * Returns the game's internal tick count. + * + * @return Game tick count. + */ +native GetGameTickCount(); + /** * Returns the game description from the mod. * diff --git a/tools/buildbot/PackageScript b/tools/buildbot/PackageScript index 540c93ca..7a664f9e 100644 --- a/tools/buildbot/PackageScript +++ b/tools/buildbot/PackageScript @@ -224,7 +224,7 @@ AddHL2Library('sourcemod', 'bin') AddNormalLibrary('sourcemod.logic', 'bin') AddNormalLibrary('sourcepawn.jit.x86', 'bin') AddNormalLibrary('geoip.ext', 'extensions') -AddNormalLibrary('dbi.mysql.ext', 'extensions') +#AddNormalLibrary('dbi.mysql.ext', 'extensions') AddNormalLibrary('dbi.sqlite.ext', 'extensions') AddNormalLibrary('game.cstrike.ext.2.ep2v', 'extensions')