-
Notifications
You must be signed in to change notification settings - Fork 21
Fix shotguns not reading number of pellets from scripts. #1910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Agiel
wants to merge
2
commits into
NeotokyoRebuild:master
Choose a base branch
from
Agiel:neo_weapon_parse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,95 @@ | ||
| //========= Copyright Valve Corporation, All rights reserved. ============// | ||
| // | ||
| // Purpose: | ||
| // | ||
| //=============================================================================// | ||
|
|
||
| #include <KeyValues.h> | ||
| #include "neo_weapon_parse.h" | ||
|
|
||
|
|
||
| FileWeaponInfo_t* CreateWeaponInfo() | ||
| { | ||
| return new CNEOWeaponInfo; | ||
| } | ||
|
|
||
|
|
||
| CNEOWeaponInfo::CNEOWeaponInfo() | ||
| { | ||
| m_iBullets = 0; | ||
| m_flCycleTime = 0.f; | ||
| szViewModel2[0] = 0; | ||
| szBulletCharacter[0] = 0; | ||
| szDeathIcon[0] = 0; | ||
| m_flPenetration = 0.f; | ||
| m_bDropOnDeath = true; | ||
| iAimFOV = 0; | ||
|
|
||
| m_flVMFov = m_flVMAimFov = 0.f; | ||
| m_vecVMPosOffset = m_vecVMAimPosOffset = vec3_origin; | ||
| m_angVMAngOffset = m_angVMAimAngOffset = vec3_angle; | ||
| } | ||
|
|
||
|
|
||
| void CNEOWeaponInfo::Parse( KeyValues *pKeyValuesData, const char *szWeaponName ) | ||
| { | ||
| BaseClass::Parse( pKeyValuesData, szWeaponName ); | ||
|
|
||
| m_iPlayerDamage = pKeyValuesData->GetInt( "Damage", 42 ); // Douglas Adams 1952 - 2001 | ||
| m_iBullets = pKeyValuesData->GetInt( "Bullets", 1 ); | ||
| m_flCycleTime = pKeyValuesData->GetFloat( "CycleTime", 0.15 ); | ||
|
|
||
| const char *notFoundStr = "notfound"; | ||
| Q_strncpy(szViewModel2, pKeyValuesData->GetString("team2viewmodel", notFoundStr), MAX_WEAPON_STRING); | ||
| // If there was no NSF viewmodel specified, fall back to Source's default "viewmodel" to ensure we have something sensible available. | ||
| // This might happen when attempting to equip a non-NT weapon. | ||
| if (Q_strcmp(szViewModel2, notFoundStr) == 0) | ||
| { | ||
| Q_strncpy(szViewModel2, pKeyValuesData->GetString("viewmodel"), MAX_WEAPON_STRING); | ||
| } | ||
|
|
||
| Q_strncpy( szBulletCharacter, pKeyValuesData->GetString("BulletCharacter", "a"), MAX_BULLET_CHARACTER); | ||
| Q_strncpy( szDeathIcon, pKeyValuesData->GetString("iDeathIcon", ""), MAX_BULLET_CHARACTER); | ||
| m_flPenetration = pKeyValuesData->GetFloat("Penetration", 0); | ||
| m_bDropOnDeath = pKeyValuesData->GetBool("DropOnDeath", true); | ||
| iAimFOV = pKeyValuesData->GetInt("AimFov", 45); | ||
|
|
||
| KeyValues *pViewModel = pKeyValuesData->FindKey("ViewModelOffset"); | ||
| if (pViewModel) | ||
| { | ||
| m_flVMFov = pKeyValuesData->GetFloat("VMFov", 60); | ||
|
|
||
| m_vecVMPosOffset.x = pViewModel->GetFloat("forward", 0); | ||
| m_vecVMPosOffset.y = pViewModel->GetFloat("right", 0); | ||
| m_vecVMPosOffset.z = pViewModel->GetFloat("up", 0); | ||
|
|
||
| m_angVMAngOffset[PITCH] = pViewModel->GetFloat("pitch", 0); | ||
| m_angVMAngOffset[YAW] = pViewModel->GetFloat("yaw", 0); | ||
| m_angVMAngOffset[ROLL] = pViewModel->GetFloat("roll", 0); | ||
| } | ||
|
|
||
| // NEO TODO (Rain): add optional ironsight offsets | ||
| // in addition to "traditional" NT aim | ||
|
|
||
| // AimOffset = Ironsight ADS offset (Disabled) | ||
| // ZoomOffset = Traditional ADS offset | ||
| #if 0 | ||
| KeyValues *pAimOffset = pKeyValuesData->FindKey("AimOffset"); | ||
| #else | ||
| KeyValues* pAimOffset = pKeyValuesData->FindKey("ZoomOffset"); | ||
| #endif | ||
| if (pAimOffset) | ||
| { | ||
| m_flVMAimFov = pAimOffset->GetFloat("fov", 55); | ||
|
|
||
| m_vecVMAimPosOffset.x = pAimOffset->GetFloat("forward", 0); | ||
| m_vecVMAimPosOffset.y = pAimOffset->GetFloat("right", 0); | ||
| m_vecVMAimPosOffset.z = pAimOffset->GetFloat("up", 0); | ||
|
|
||
| m_angVMAimAngOffset[PITCH] = pAimOffset->GetFloat("pitch", 0); | ||
| m_angVMAimAngOffset[YAW] = pAimOffset->GetFloat("yaw", 0); | ||
| m_angVMAimAngOffset[ROLL] = pAimOffset->GetFloat("roll", 0); | ||
| } | ||
| } | ||
|
|
||
|
|
This file contains hidden or 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,44 @@ | ||
| //========= Copyright Valve Corporation, All rights reserved. ============// | ||
| // | ||
| // Purpose: | ||
| // | ||
| //=============================================================================// | ||
|
|
||
| #ifndef NEO_WEAPON_PARSE_H | ||
| #define NEO_WEAPON_PARSE_H | ||
| #ifdef _WIN32 | ||
| #pragma once | ||
| #endif | ||
|
|
||
| #include "hl2mp_weapon_parse.h" | ||
|
|
||
| //-------------------------------------------------------------------------------------------------------- | ||
| class CNEOWeaponInfo : public CHL2MPSWeaponInfo | ||
| { | ||
| public: | ||
| DECLARE_CLASS_GAMEROOT( CNEOWeaponInfo, CHL2MPSWeaponInfo ); | ||
|
|
||
| CNEOWeaponInfo(); | ||
|
|
||
| virtual void Parse( ::KeyValues *pKeyValuesData, const char *szWeaponName ); | ||
|
|
||
| int m_iBullets; | ||
| float m_flCycleTime; | ||
| char szViewModel2[MAX_WEAPON_STRING]; // Team 2 (NSF) wep vm | ||
| char szBulletCharacter[MAX_BULLET_CHARACTER];// character used to display ammunition in current clip | ||
| char szDeathIcon[MAX_BULLET_CHARACTER]; | ||
| float m_flPenetration; | ||
| bool m_bDropOnDeath; | ||
| int iAimFOV; | ||
|
|
||
| float m_flVMFov; | ||
| Vector m_vecVMPosOffset; | ||
| QAngle m_angVMAngOffset; | ||
|
|
||
| float m_flVMAimFov; | ||
| Vector m_vecVMAimPosOffset; | ||
| QAngle m_angVMAimAngOffset; | ||
| }; | ||
|
|
||
|
|
||
| #endif // NEO_WEAPON_PARSE_H |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno if you were getting a warning that was blocking the build, but wonder if we could actually keep the
#ifndef NEOhere so that we don't set m_iPLayerDamage twice, since this value may get clobbered and never used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to restore this file to it's original state. In general I think we should avoid ifdefs unless absolutely necessary.
So ifdefing out this line would have no effect as far as I can tell.