-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from tmp64/gamedata-vtable
AMXX GameData VTable Offsets
- Loading branch information
Showing
8 changed files
with
262 additions
and
145 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
gamedir/amxmodx/data/gamedata/weaponmod.games/master.games.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"Game Master" | ||
{ | ||
// | ||
// Half-Life: Deathmatch | ||
// | ||
|
||
"valve/offsets-vtable.txt" | ||
{ | ||
"game" "valve" | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
gamedir/amxmodx/data/gamedata/weaponmod.games/valve/offsets-vtable.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
"Games" | ||
{ | ||
"#default" | ||
{ | ||
"Offsets" | ||
{ | ||
"AddAmmo" | ||
{ | ||
"windows" "57" | ||
"linux" "59" | ||
} | ||
|
||
"AddToPlayer" | ||
{ | ||
"windows" "58" | ||
"linux" "60" | ||
} | ||
|
||
"CanDeploy" | ||
{ | ||
"windows" "61" | ||
"linux" "63" | ||
} | ||
|
||
"Deploy" | ||
{ | ||
"windows" "62" | ||
"linux" "64" | ||
} | ||
|
||
"CanHolster" | ||
{ | ||
"windows" "63" | ||
"linux" "65" | ||
} | ||
|
||
"Holster" | ||
{ | ||
"windows" "64" | ||
"linux" "66" | ||
} | ||
|
||
"ItemPostFrame" | ||
{ | ||
"windows" "67" | ||
"linux" "69" | ||
} | ||
|
||
"ItemSlot" | ||
{ | ||
"windows" "75" | ||
"linux" "77" | ||
} | ||
|
||
"IsUseable" | ||
{ | ||
"windows" "82" | ||
"linux" "84" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
add_sources( | ||
sdk/amxx_gameconfigs.h | ||
sdk/amxxmodule.cpp | ||
sdk/amxxmodule.h | ||
sdk/HLTypeConversion.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Half-Life Weapon Mod | ||
* Copyright (c) 2012 - 2023 AGHL.RU Dev Team | ||
* | ||
* http://aghl.ru/forum/ - Russian Half-Life and Adrenaline Gamer Community | ||
* | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* In addition, as a special exception, the author gives permission to | ||
* link the code of this program with the Half-Life Game Engine ("HL | ||
* Engine") and Modified Game Libraries ("MODs") developed by Valve, | ||
* L.L.C ("Valve"). You must obey the GNU General Public License in all | ||
* respects for all of the code used other than the HL Engine and MODs | ||
* from Valve. If you modify this file, you may extend this exception | ||
* to your version of the file, but you are not obligated to do so. If | ||
* you do not wish to do so, delete this exception statement from your | ||
* version. | ||
* | ||
*/ | ||
|
||
#pragma once | ||
#include <memory> | ||
#include "sdk/amxxmodule.h" | ||
#include "sdk/IGameConfigs.h" | ||
#include "wpnmod_log.h" | ||
|
||
//! Deleter for IGameConfig pointers. | ||
struct AmxxGameConfigDeleter | ||
{ | ||
void operator()(IGameConfig* pCfg) | ||
{ | ||
MF_GetConfigManager()->CloseGameConfigFile(pCfg); | ||
} | ||
}; | ||
|
||
//! Smart pointer for IGameConfig. | ||
using IGameConfigPtr = std::unique_ptr<IGameConfig, AmxxGameConfigDeleter>; | ||
|
||
//! Loads a game config file. Crashes if fails. | ||
static IGameConfigPtr WpnMod_LoadGameConfigFile(const char* file) | ||
{ | ||
IGameConfig* pCfg = nullptr; | ||
char error[256] = ""; | ||
|
||
if (!MF_GetConfigManager()->LoadGameConfigFile(file, &pCfg, error, sizeof(error))) | ||
{ | ||
WPNMOD_LOG("Failed to load game config '%s': %s\n", file, error); | ||
std::abort(); | ||
} | ||
|
||
return IGameConfigPtr(pCfg, AmxxGameConfigDeleter()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.