From a87f1d24186189a5b76ca6c882cdefeb5d67604d Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Tue, 18 Apr 2017 18:05:40 -0500 Subject: [PATCH] Adds note about unrelated new to initialize changes. --- .github/CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 859af746b4..403526d30b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -146,6 +146,7 @@ Remember, this tradeoff makes sense in many cases but not all, you should think ### Prefer `Initialize` over `New` for atoms Our game controller is pretty good at handling long operations and lag. But, it can't control what happens when the map is loaded, which calls `New` for all atoms on the map. If you're creating a new atom, use the `Initialize` proc to do what you would normally do in `New`. This cuts down on the number of proc calls needed when the world is loaded. See here for details on `Initialize`: https://github.com/tgstation/tgstation/blob/master/code/game/atoms.dm#L49 +While we normally encourage (and in some cases, even require) bringing out of date code up to date when you make unrelated changes near the out of date code, that is not the case for `New` -> `Initialize` conversions. These systems are generally more dependant on parent and children procs so unrelated random conversions of existing things can cause bugs that take months to figure out. ### No magic numbers or strings Make these #defines with a name that more clearly states what it's for.