Skip to content

Commit 384cfc7

Browse files
Fix: Added null reference check to ClientInputSender script [MTT-6672] (#880)
* Added null reference check to ClientInputSender script * Fixed whitepsace issue * Update CHANGELOG.md * Update CHANGELOG.md pr number * Revert "Fixed whitepsace issue" This reverts commit edc03c3. * fix line 478 * Update CHANGELOG.md Co-authored-by: Fernando Cortez <[email protected]> --------- Co-authored-by: Fernando Cortez <[email protected]>
1 parent 3779763 commit 384cfc7

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,27 +473,27 @@ public void RequestAction(ActionID actionID, SkillTriggerStyle triggerStyle, ulo
473473

474474
void Update()
475475
{
476-
if (Input.GetKeyDown(KeyCode.Alpha1))
476+
if (Input.GetKeyDown(KeyCode.Alpha1) && CharacterClass.Skill1)
477477
{
478478
RequestAction(actionState1.actionID, SkillTriggerStyle.Keyboard);
479479
}
480-
else if (Input.GetKeyUp(KeyCode.Alpha1))
480+
else if (Input.GetKeyUp(KeyCode.Alpha1) && CharacterClass.Skill1)
481481
{
482482
RequestAction(actionState1.actionID, SkillTriggerStyle.KeyboardRelease);
483483
}
484-
if (Input.GetKeyDown(KeyCode.Alpha2))
484+
if (Input.GetKeyDown(KeyCode.Alpha2) && CharacterClass.Skill2)
485485
{
486486
RequestAction(actionState2.actionID, SkillTriggerStyle.Keyboard);
487487
}
488-
else if (Input.GetKeyUp(KeyCode.Alpha2))
488+
else if (Input.GetKeyUp(KeyCode.Alpha2) && CharacterClass.Skill2)
489489
{
490490
RequestAction(actionState2.actionID, SkillTriggerStyle.KeyboardRelease);
491491
}
492-
if (Input.GetKeyDown(KeyCode.Alpha3))
492+
if (Input.GetKeyDown(KeyCode.Alpha3) && CharacterClass.Skill3)
493493
{
494494
RequestAction(actionState3.actionID, SkillTriggerStyle.Keyboard);
495495
}
496-
else if (Input.GetKeyUp(KeyCode.Alpha3))
496+
else if (Input.GetKeyUp(KeyCode.Alpha3) && CharacterClass.Skill3)
497497
{
498498
RequestAction(actionState3.actionID, SkillTriggerStyle.KeyboardRelease);
499499
}

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Additional documentation and release notes are available at [Multiplayer Documen
1111
### Cleanup
1212
* Removed NetworkObject from MainMenuState (#881)
1313

14+
### Fixed
15+
* Added Null reference check to ClientInputSender to fix null reference for missing ability (#880)
16+
17+
1418
## [2.4.0] - 2023-12-13
1519

1620
### Changed
@@ -105,7 +109,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
105109
* Updated Boss Room to NGO 1.1.0 (#708)
106110
* Now uses managed types for custom INetworkSerializable in NetworkVariables. NetworkGUID is now a class instead of a struct.
107111
* Cleanup Relay and UTP setup. Flow is now simpler, no need for the RelayUtilities anymore.
108-
* This cleansup various setup steps and puts them all in a new "ConnectionMethod.cs".
112+
* This cleans up various setup steps and puts them all in a new "ConnectionMethod.cs".
109113
* MaxSendQueueSize value is removed, reserialized NetworkManager to remove that now useless value.
110114
* Reverted the default value for max payload size, this is no longer useful as NGO is mostly reliable.
111115
* Set connection approval timeout higher, 1 sec is pretty short. If there's a packet drop, some hangups on the network, clients would get timedout too easily.

0 commit comments

Comments
 (0)