CWorld::KeyValue
0x00b61170 · 1015 bytes · __thiscall
_ZN6CWorld8KeyValueEPKcS1_
Decompiled
undefined (3 params)
/* CWorld::KeyValue(char const*, char const*) */
undefined4 __thiscall CWorld::KeyValue(CWorld *this,char *param_1,char *param_2)
{
CBaseEdict *pCVar1;
int iVar2;
undefined4 uVar3;
long lVar4;
int local_30 [2];
undefined4 *local_28;
float local_24;
float local_20 [4];
if ((param_1 == "skyname") || (iVar2 = _V_stricmp(param_1,"skyname"), iVar2 == 0)) {
ConVarRef::ConVarRef((ConVarRef *)&local_28,"sv_skyname");
(**(code **)*local_28)(local_28,param_2);
return 1;
}
if ((param_1 == "newunit") || (iVar2 = _V_stricmp(param_1,"newunit"), iVar2 == 0)) {
lVar4 = strtol(param_2,(char **)0x0,10);
if (lVar4 != 0) {
Game_SetOneWayTransition();
return 1;
}
}
else if ((param_1 == "world_mins") || (iVar2 = _V_stricmp(param_1,"world_mins"), iVar2 == 0)) {
sscanf(param_2,"%f %f %f",&local_28,&local_24,local_20);
if (((float)local_28 != *(float *)(this + 0x448)) ||
((local_24 != *(float *)(this + 0x44c) || (local_20[0] != *(float *)(this + 0x450))))) {
if (this[0x6c] == (CWorld)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this[0x70] = (CWorld)((byte)this[0x70] | 1);
}
*(undefined4 **)(this + 0x448) = local_28;
*(float *)(this + 0x44c) = local_24;
*(float *)(this + 0x450) = local_20[0];
}
}
else if ((param_1 == "world_maxs") || (iVar2 = _V_stricmp(param_1,"world_maxs"), iVar2 == 0)) {
sscanf(param_2,"%f %f %f",&local_28,&local_24,local_20);
if (((float)local_28 != *(float *)(this + 0x454)) ||
((local_24 != *(float *)(this + 0x458) || (local_20[0] != *(float *)(this + 0x45c))))) {
if (this[0x6c] == (CWorld)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this[0x70] = (CWorld)((byte)this[0x70] | 1);
}
*(undefined4 **)(this + 0x454) = local_28;
*(float *)(this + 0x458) = local_24;
*(float *)(this + 0x45c) = local_20[0];
}
}
else {
if ((param_1 != "timeofday") && (iVar2 = _V_stricmp(param_1,"timeofday"), iVar2 != 0)) {
if ((param_1 != "startmusictype") &&
(iVar2 = _V_stricmp(param_1,"startmusictype"), iVar2 != 0)) {
if ((param_1 != "musicpostfix") && (iVar2 = _V_stricmp(param_1,"musicpostfix"), iVar2 != 0))
{
uVar3 = CBaseEntity::KeyValue((CBaseEntity *)this,param_1,param_2);
return uVar3;
}
AllocPooledString((char *)local_30);
if (local_30[0] == *(int *)(this + 0x480)) {
return 1;
}
if (this[0x6c] == (CWorld)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this[0x70] = (CWorld)((byte)this[0x70] | 1);
}
*(int *)(this + 0x480) = local_30[0];
return 1;
}
lVar4 = strtol(param_2,(char **)0x0,10);
if (lVar4 != *(int *)(this + 0x47c)) {
if (this[0x6c] == (CWorld)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this[0x70] = (CWorld)((byte)this[0x70] | 1);
}
*(long *)(this + 0x47c) = lVar4;
return 1;
}
return 1;
}
lVar4 = strtol(param_2,(char **)0x0,10);
if (lVar4 != *(int *)(this + 0x478)) {
if (this[0x6c] == (CWorld)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this[0x70] = (CWorld)((byte)this[0x70] | 1);
}
*(long *)(this + 0x478) = lVar4;
return 1;
}
}
return 1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.