Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Using bad coding practices #1407

Open
Killfrra opened this issue Apr 14, 2022 · 1 comment
Open

Using bad coding practices #1407

Killfrra opened this issue Apr 14, 2022 · 1 comment

Comments

@Killfrra
Copy link
Contributor

From Effective C++, by Scott Meyers:

Anytime you find yourself writing code of the form "if the object is of type T1, then do something, but if it's of type T2, then do something else," slap yourself

lzardy pushed a commit that referenced this issue May 1, 2022
For `GameObject`s, the `LateUpdate`, `Sync`, `OnAfterSync` and `OnReconnect` functions have been introduced.
The next step is to move the some of the function calls from `PacketNotifier` to `OnEnter/LeaveVision`, `OnSync` and `OnSpawn`.
lzardy pushed a commit that referenced this issue May 1, 2022
I refactored the `HandleSpawn` class and unified the spawning of champions with the spawning of other objects, moving most of the code into the appropriate class.

Other changes:
- The `NotifyS2C_CreateHero` function now accepts an optional parameter that allows the packet to be wrapped in a vision packet when sent, similar to the `NotifySpawn` function.
- The same setting for `NotifySpawn` is now set to false by default.
- All comparisons of `userId` with `0` are reduced to the form `<=`.
@Killfrra
Copy link
Contributor Author

Killfrra commented May 4, 2022

Directly related to #481

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant