forked from ValveSoftware/source-sdk-2013
-
Notifications
You must be signed in to change notification settings - Fork 145
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 #183 from Petercov/mapbase-feature/custom-weapons
Enhanced custom weapons support
- Loading branch information
Showing
21 changed files
with
2,381 additions
and
35 deletions.
There are no files selected for viewing
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
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
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,67 @@ | ||
//========= Mapbase - https://github.com/mapbase-source/source-sdk-2013 ============// | ||
// | ||
// Purpose: Client classes for Half-Life 2 based custom weapons. | ||
// | ||
// Author: Peter Covington ([email protected]) | ||
// | ||
//==================================================================================// | ||
|
||
#include "cbase.h" | ||
#include "c_weapon__stubs.h" | ||
#include "basehlcombatweapon_shared.h" | ||
#include "c_basehlcombatweapon.h" | ||
|
||
// memdbgon must be the last include file in a .cpp file!!! | ||
#include "tier0/memdbgon.h" | ||
|
||
class C_HLCustomWeaponMelee : public C_BaseHLBludgeonWeapon | ||
{ | ||
public: | ||
DECLARE_CLASS(C_HLCustomWeaponMelee, C_BaseHLBludgeonWeapon); | ||
DECLARE_CLIENTCLASS(); | ||
DECLARE_PREDICTABLE(); | ||
|
||
C_HLCustomWeaponMelee(); | ||
|
||
virtual const char* GetWeaponScriptName() { return m_iszWeaponScriptName; } | ||
private: | ||
char m_iszWeaponScriptName[128]; | ||
}; | ||
|
||
STUB_WEAPON_CLASS_IMPLEMENT(weapon_hlcustommelee, C_HLCustomWeaponMelee); | ||
|
||
IMPLEMENT_CLIENTCLASS_DT(C_HLCustomWeaponMelee, DT_HLCustomWeaponMelee, CHLCustomWeaponMelee) | ||
RecvPropString(RECVINFO(m_iszWeaponScriptName)), | ||
END_RECV_TABLE(); | ||
|
||
C_HLCustomWeaponMelee::C_HLCustomWeaponMelee() | ||
{ | ||
m_iszWeaponScriptName[0] = '\0'; | ||
} | ||
|
||
|
||
|
||
class C_HLCustomWeaponGun : public C_BaseHLCombatWeapon | ||
{ | ||
public: | ||
DECLARE_CLASS(C_HLCustomWeaponGun, C_BaseHLCombatWeapon); | ||
DECLARE_CLIENTCLASS(); | ||
DECLARE_PREDICTABLE(); | ||
|
||
C_HLCustomWeaponGun(); | ||
|
||
virtual const char* GetWeaponScriptName() { return m_iszWeaponScriptName; } | ||
private: | ||
char m_iszWeaponScriptName[128]; | ||
}; | ||
|
||
STUB_WEAPON_CLASS_IMPLEMENT(weapon_hlcustomgun, C_HLCustomWeaponGun); | ||
|
||
IMPLEMENT_CLIENTCLASS_DT(C_HLCustomWeaponGun, DT_HLCustomWeaponGun, CHLCustomWeaponGun) | ||
RecvPropString(RECVINFO(m_iszWeaponScriptName)), | ||
END_RECV_TABLE(); | ||
|
||
C_HLCustomWeaponGun::C_HLCustomWeaponGun() | ||
{ | ||
m_iszWeaponScriptName[0] = '\0'; | ||
} |
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
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.