From cef3a54a995b564e1ae2530b08736bec717bd050 Mon Sep 17 00:00:00 2001 From: Qustinnus Date: Fri, 1 May 2020 02:15:15 +0200 Subject: [PATCH] contribution (#50664) --- .github/CONTRIBUTING.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a6010bbe77f8b..70f53a4aefe4c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -206,6 +206,30 @@ This is good: ```` This prevents nesting levels from getting deeper then they need to be. +### Use our time defines + +The codebase contains some defines which will automatically multiply a number by the correct amount to get a number in deciseconds. Using these is preffered over using a literal amount in deciseconds. + +The defines are as follows: +* SECONDS +* MINUTES +* HOURS + +This is bad: +````DM +/datum/datum1/proc/proc1() + if(do_after(mob, 15)) + mob.dothing() +```` + +This is good: +````DM +/datum/datum1/proc/proc1() + if(do_after(mob, 1.5 SECONDS)) + mob.dothing() +```` + + ### Develop Secure Code * Player input must always be escaped safely, we recommend you use stripped_input in all cases where you would use input. Essentially, just always treat input from players as inherently malicious and design with that use case in mind