Cstrike: Fix typos and improve things

This commit is contained in:
Arkshine 2015-07-14 19:36:36 +02:00
parent dcc2d91b14
commit 662fa61fc7
8 changed files with 73 additions and 49 deletions

View File

@ -21,217 +21,217 @@
{ {
"m_Activity" // int "m_Activity" // int
{ {
"windows" "424" "windows" "384"
"linux" "404" "linux" "404"
"mac" "404" "mac" "404"
} }
"m_bTouched" // BOOL "m_bTouched" // BOOL
{ {
"windows" "428" "windows" "388"
"linux" "408" "linux" "408"
"mac" "408" "mac" "408"
} }
"m_bRescueMe" // BOOL "m_bRescueMe" // BOOL
{ {
"windows" "432" "windows" "392"
"linux" "412" "linux" "412"
"mac" "412" "mac" "412"
} }
"m_flFlinchTime" // float "m_flFlinchTime" // float
{ {
"windows" "436" "windows" "396"
"linux" "416" "linux" "416"
"mac" "416" "mac" "416"
} }
"m_flNextChange" // float "m_flNextChange" // float
{ {
"windows" "440" "windows" "400"
"linux" "420" "linux" "420"
"mac" "420" "mac" "420"
} }
"m_flMarkPosition" // float "m_flMarkPosition" // float
{ {
"windows" "444" "windows" "404"
"linux" "424" "linux" "424"
"mac" "424" "mac" "424"
} }
"m_iModel" // int "m_iModel" // int
{ {
"windows" "448" "windows" "408"
"linux" "428" "linux" "428"
"mac" "428" "mac" "428"
} }
"m_iSkin" // int "m_iSkin" // int
{ {
"windows" "452" "windows" "412"
"linux" "432" "linux" "432"
"mac" "432" "mac" "432"
} }
"m_flNextRadarTime" // float "m_flNextRadarTime" // float
{ {
"windows" "456" "windows" "416"
"linux" "436" "linux" "436"
"mac" "436" "mac" "436"
} }
"m_State" // enum state "m_State" // enum state
{ {
"windows" "460" "windows" "420"
"linux" "440" "linux" "440"
"mac" "440" "mac" "440"
} }
"m_vStart" // Vector "m_vStart" // Vector
{ {
"windows" "464" "windows" "424"
"linux" "444" "linux" "444"
"mac" "444" "mac" "444"
} }
"m_vStartAngles" // Vector "m_vStartAngles" // Vector
{ {
"windows" "476" "windows" "436"
"linux" "456" "linux" "456"
"mac" "456" "mac" "456"
} }
"m_vPathToFollow" // Vector[20] "m_vPathToFollow" // Vector[20]
{ {
"windows" "488" "windows" "448"
"linux" "468" "linux" "468"
"mac" "468" "mac" "468"
} }
"m_iWaypoint" // int "m_iWaypoint" // int
{ {
"windows" "728" "windows" "688"
"linux" "708" "linux" "708"
"mac" "708" "mac" "708"
} }
"m_target" // CBasePlayer* "m_target" // CBasePlayer*
{ {
"windows" "732" "windows" "692"
"linux" "712" "linux" "712"
"mac" "712" "mac" "712"
} }
"m_LocalNav" // CLocalNav* "m_LocalNav" // CLocalNav*
{ {
"windows" "736" "windows" "696"
"linux" "716" "linux" "716"
"mac" "716" "mac" "716"
} }
"nTargetNode" // int "nTargetNode" // int
{ {
"windows" "740" "windows" "700"
"linux" "720" "linux" "720"
"mac" "720" "mac" "720"
} }
"vecNodes" // Vector[100] "vecNodes" // Vector[100]
{ {
"windows" "744" "windows" "704"
"linux" "724" "linux" "724"
"mac" "724" "mac" "724"
} }
"m_hStoppedTargetEnt" // EHANDLE "m_hStoppedTargetEnt" // EHANDLE
{ {
"windows" "1944" "windows" "1904"
"linux" "1924" "linux" "1924"
"mac" "1924" "mac" "1924"
} }
"m_flNextFullThink" // float "m_flNextFullThink" // float
{ {
"windows" "1952" "windows" "1912"
"linux" "1932" "linux" "1932"
"mac" "1932" "mac" "1932"
} }
"m_flPathCheckInterval" // float "m_flPathCheckInterval" // float
{ {
"windows" "1956" "windows" "1916"
"linux" "1936" "linux" "1936"
"mac" "1936" "mac" "1936"
} }
"m_flLastPathCheck" // float "m_flLastPathCheck" // float
{ {
"windows" "1960" "windows" "1920"
"linux" "1940" "linux" "1940"
"mac" "1940" "mac" "1940"
} }
"m_nPathNodes" // int "m_nPathNodes" // int
{ {
"windows" "1964" "windows" "1924"
"linux" "1944" "linux" "1944"
"mac" "1944" "mac" "1944"
} }
"m_fHasPath" // BOOL "m_fHasPath" // BOOL
{ {
"windows" "1968" "windows" "1928"
"linux" "1948" "linux" "1948"
"mac" "1948" "mac" "1948"
} }
"m_flPathAcquired" // float "m_flPathAcquired" // float
{ {
"windows" "1972" "windows" "1932"
"linux" "1952" "linux" "1952"
"mac" "1952" "mac" "1952"
} }
"m_vOldPos" // Vector "m_vOldPos" // Vector
{ {
"windows" "1976" "windows" "1936"
"linux" "1956" "linux" "1956"
"mac" "1956" "mac" "1956"
} }
"m_iHostageIndex" // int "m_iHostageIndex" // int
{ {
"windows" "1988" "windows" "1948"
"linux" "1968" "linux" "1968"
"mac" "1968" "mac" "1968"
} }
"m_bStuck" // BOOL "m_bStuck" // BOOL
{ {
"windows" "1992" "windows" "1952"
"linux" "1972" "linux" "1972"
"mac" "1972" "mac" "1972"
} }
"m_flStuckTime" // float "m_flStuckTime" // float
{ {
"windows" "1996" "windows" "1956"
"linux" "1976" "linux" "1976"
"mac" "1976" "mac" "1976"
} }
"m_improv" // CHostageImprov* "m_improv" // CHostageImprov*
{ {
"windows" "2000" "windows" "1960"
"linux" "1980" "linux" "1980"
"mac" "1980" "mac" "1980"
} }
"m_whichModel" // enum ModelType "m_whichModel" // enum ModelType
{ {
"windows" "2004" "windows" "1964"
"linux" "1984" "linux" "1984"
"mac" "1984" "mac" "1984"
} }

View File

@ -47,7 +47,7 @@
#define CSI_SG552 CSW_SG552 #define CSI_SG552 CSW_SG552
#define CSI_AK47 CSW_AK47 #define CSI_AK47 CSW_AK47
#define CSI_P90 CSW_P90 #define CSI_P90 CSW_P90
#define CSI_SHIELDGUN CSW_SHIELDGUN // The real CS value, use CSI_SHELD instead. #define CSI_SHIELDGUN CSW_SHIELDGUN // The real CS value, use CSI_SHIELD instead.
#define CSI_VEST CSW_VEST // Custom #define CSI_VEST CSW_VEST // Custom
#define CSI_VESTHELM CSW_VESTHELM // Custom #define CSI_VESTHELM CSW_VESTHELM // Custom
#define CSI_DEFUSER 33 // Custom #define CSI_DEFUSER 33 // Custom

View File

@ -536,6 +536,11 @@ void InitGlobalVars()
Server = *reinterpret_cast<server_t**>(address); Server = *reinterpret_cast<server_t**>(address);
} }
if (!ServerStatic)
{
MF_Log("svs global variable is not available\n");
}
if (!Server) if (!Server)
{ {
MF_Log("sv global variable is not available\n"); MF_Log("sv global variable is not available\n");

View File

@ -473,7 +473,7 @@ static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params)
} }
set_pdata<int>(pPlayer, m_iModelName, modelName); set_pdata<int>(pPlayer, m_iModelName, modelName);
MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); Players[index].ResetModel(pPlayer);
} }
if (updateScoreboard) if (updateScoreboard)
@ -837,10 +837,11 @@ static cell AMX_NATIVE_CALL cs_set_user_nvg(AMX *amx, cell *params)
if (nvg && get_pdata<bool>(pPlayer, m_bHasNightVision)) if (nvg && get_pdata<bool>(pPlayer, m_bHasNightVision))
{ {
UTIL_TextMsg_Generic(pPlayer, "#Already_Have_One"); UTIL_TextMsg_Generic(pPlayer, "#Already_Have_One");
return 1;
} }
else
{
set_pdata<bool>(pPlayer, m_bHasNightVision, nvg); set_pdata<bool>(pPlayer, m_bHasNightVision, nvg);
}
return 1; return 1;
} }
@ -887,7 +888,7 @@ static cell AMX_NATIVE_CALL cs_set_user_model(AMX *amx, cell *params)
{ {
if (!Server) if (!Server)
{ {
MF_LogError(amx, AMX_ERR_NATIVE, "cs_set_user_model is disabled with update_index parameter set"); MF_Log("cs_set_user_model is disabled with update_index parameter set");
return 0; return 0;
} }
@ -910,7 +911,7 @@ static cell AMX_NATIVE_CALL cs_set_user_model(AMX *amx, cell *params)
} }
} }
MF_LogError(amx, AMX_ERR_NATIVE, "Model must be precached"); MF_Log("Model must be precached using cs_set_user_model with update_index parameter set");
return 0; return 0;
} }

View File

@ -51,6 +51,18 @@ void StartFrame()
if (ModelsUpdateQueue.empty()) if (ModelsUpdateQueue.empty())
{ {
g_pFunctionTable->pfnStartFrame = nullptr; g_pFunctionTable->pfnStartFrame = nullptr;
for (int i = 1; i < gpGlobals->maxClients; ++i)
{
if (Players[i].HasModel())
{
RETURN_META(MRES_IGNORED);
}
}
g_pFunctionTable->pfnClientUserInfoChanged = nullptr;
g_pengfuncsTable->pfnSetClientKeyValue = nullptr;
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }

View File

@ -70,7 +70,7 @@ class CPlayer
{ {
MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer));
PostponeModeUpdate(ENTINDEX(pPlayer) - 1); PostponeModelUpdate(ENTINDEX(pPlayer) - 1);
} }
} }
@ -89,7 +89,7 @@ class CPlayer
SETCLIENTKEYVALUE(index, infobuffer, "model", m_Model); SETCLIENTKEYVALUE(index, infobuffer, "model", m_Model);
PostponeModeUpdate(index - 1); PostponeModelUpdate(index - 1);
} }
} }
@ -110,18 +110,24 @@ class CPlayer
private: private:
void PostponeModeUpdate(int index) void PostponeModelUpdate(int index)
{ {
ServerStatic->clients[index].sendinfo = false;
ModelsUpdateQueue.append(index);
if (!g_pFunctionTable->pfnStartFrame) if (!g_pFunctionTable->pfnStartFrame)
{ {
g_pFunctionTable->pfnStartFrame = StartFrame; g_pFunctionTable->pfnStartFrame = StartFrame;
g_pFunctionTable->pfnClientUserInfoChanged = ClientUserInfoChanged; g_pFunctionTable->pfnClientUserInfoChanged = ClientUserInfoChanged;
g_pengfuncsTable->pfnSetClientKeyValue = SetClientKeyValue; g_pengfuncsTable->pfnSetClientKeyValue = SetClientKeyValue;
} }
if (!ServerStatic)
{
MF_Log("Postponing of model update disabled, check your gamedata files");
return;
}
ServerStatic->clients[index].sendinfo = false;
ModelsUpdateQueue.append(index);
} }
private: private:

View File

@ -41,7 +41,7 @@ UserMsg MessagesList[] =
{ {
{ "ArmorType" , &MessageIdArmorType }, { "ArmorType" , &MessageIdArmorType },
{ "HLTV" , &MessageIdHLTV }, { "HLTV" , &MessageIdHLTV },
{ "CurWeapon" , &MessageIdMoney }, { "Money" , &MessageIdMoney },
{ "ResetHUD" , &MessageIdResetHUD }, { "ResetHUD" , &MessageIdResetHUD },
{ "ScoreAttrib", &MessageIdScoreAttrib }, { "ScoreAttrib", &MessageIdScoreAttrib },
{ "ScoreInfo" , &MessageIdScoreInfo }, { "ScoreInfo" , &MessageIdScoreInfo },

View File

@ -578,7 +578,7 @@ native cs_set_user_tked(index, tk = 1, subtract = 1);
* @return 0 if the client is not driving, 1 if driving a vehicle but * @return 0 if the client is not driving, 1 if driving a vehicle but
* not moving, 2 to 4 if driving positive speeds, 5 if * not moving, 2 to 4 if driving positive speeds, 5 if
* driving at a negative speed (backing), see TRAIN_* constants * driving at a negative speed (backing), see TRAIN_* constants
* in hlsdk_cons.inc * in hlsdk_const.inc
* @error If the client index is not within the range of 1 to * @error If the client index is not within the range of 1 to
* MaxClients, or the client is not connected, an error will be * MaxClients, or the client is not connected, an error will be
* thrown. * thrown.
@ -1045,7 +1045,7 @@ native Float:cs_get_hostage_nextuse(index);
native cs_set_hostage_nextuse(index, Float:value); native cs_set_hostage_nextuse(index, Float:value);
/** /**
* Returns the time the bomb will explode. * Returns the game time at which the bomb will explode.
* *
* @param index C4 entity * @param index C4 entity
* *
@ -1056,7 +1056,7 @@ native cs_set_hostage_nextuse(index, Float:value);
native Float:cs_get_c4_explode_time(index); native Float:cs_get_c4_explode_time(index);
/** /**
* Sets the time the bomb will explode. * Sets the game time at which the bomb will explode.
* *
* @param index C4 entity * @param index C4 entity
* @param value New explosion time * @param value New explosion time