-
Notifications
You must be signed in to change notification settings - Fork 20
neo_worldpos_marker and neo_npc_targetsystem penetration #1615
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
base: master
Are you sure you want to change the base?
neo_worldpos_marker and neo_npc_targetsystem penetration #1615
Conversation
| const float halfArrowLength = HALF_BASE_TEX_LENGTH * scale; | ||
| vgui::surface()->DrawSetColor(targetColor); | ||
| vgui::surface()->DrawTexturedRect( | ||
| x - halfArrowLength, | ||
| y - halfArrowLength, | ||
| x + halfArrowLength, | ||
| y + halfArrowLength); | ||
| } | ||
| else | ||
| { | ||
| const float halfArrowLength = HALF_BASE_TEX_LENGTH * scale; | ||
| vgui::surface()->DrawSetColor( targetColor ); | ||
| vgui::surface()->DrawTexturedRect( | ||
| x - halfArrowLength, | ||
| y - halfArrowLength, | ||
| x + halfArrowLength, | ||
| y + halfArrowLength); |
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.
Nit: since we're repeating these lines for both the "if" and the "else", could simplify by removing the else branch entirely, and just executing these lines unconditionally at the end of the function:
-
- const float halfArrowLength = HALF_BASE_TEX_LENGTH * scale;
- vgui::surface()->DrawSetColor(targetColor);
- vgui::surface()->DrawTexturedRect(
- x - halfArrowLength,
- y - halfArrowLength,
- x + halfArrowLength,
- y + halfArrowLength);
- }
- else
- {
- const float halfArrowLength = HALF_BASE_TEX_LENGTH * scale;
- vgui::surface()->DrawSetColor( targetColor );
- vgui::surface()->DrawTexturedRect(
- x - halfArrowLength,
- y - halfArrowLength,
- x + halfArrowLength,
- y + halfArrowLength);
}
+ const float halfArrowLength = HALF_BASE_TEX_LENGTH * scale;
+ vgui::surface()->DrawSetColor(targetColor);
+ vgui::surface()->DrawTexturedRect(
+ x - halfArrowLength,
+ y - halfArrowLength,
+ x + halfArrowLength,
+ y + halfArrowLength);| auto pNeoAttacker = dynamic_cast<CNEO_Player*>(this); | ||
| Assert(pNeoAttacker); | ||
| pNeoAttacker->m_bIneligibleForLoadoutPick = true; |
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.
Nit: this could be assert_cast, since it will be faster for Release builds but still does the Assert for Debug. Line 1759 on the other hand definitely should remain a dynamic_cast, since we do test the nullptr case for it.
|
|
||
| Assert( ICON_TOTAL == ARRAYSIZE(ICON_PATHS) ); |
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.
Nit: this run-time Assert could be changed to compile-time static_assert (or alternatively COMPILE_TIME_ASSERT, which is a convenience wrapper around static_assert)
| #ifdef GAME_DLL | ||
| virtual void Spawn(); |
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.
Nit: would prefer if we specify override explicitly
| float m_fMarkerScalesCurrent[4] = { 0.78f, 0.6f, 0.38f, 0.0f }; | ||
| wchar_t m_wszMarkerTextUnicode[64 + 1] = {}; | ||
| Vector m_vecMyPos = vec3_origin; | ||
| vgui::HFont m_hFont = 0UL; |
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.
Nit: maybe initialize m_hFont as vgui::INVALID_FONT, instead of using the magic value 0UL
| { | ||
| Assert( !m_pHUD_WorldPosMarker ); |
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.
Nit: probably redundant Assert, since the if-condition above already checks for this
Description
Toolchain
Linked Issues