mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
updates the contributing guide to disallow for direct var access from function returns (#24090)
This commit is contained in:
@@ -176,6 +176,19 @@ All new user interfaces in the game must be created using the TGUI framework. Do
|
||||
|
||||
The use of the `:` operator to override type safety checks is not allowed. You must cast the variable to the proper type.
|
||||
|
||||
### Do not access return value vars directly from functions
|
||||
|
||||
The use of the pointer operator, `.`, should not be used to access the return values of functions directly. This can cause unintended behavior and is difficult to read.
|
||||
|
||||
```dm
|
||||
//Bad
|
||||
var/our_x = get_turf(thing).x
|
||||
|
||||
//Good
|
||||
var/turf/our_turf = get_turf(thing)
|
||||
var/our_x = our_turf.x
|
||||
```
|
||||
|
||||
### Type paths must begin with a /
|
||||
|
||||
eg: `/datum/thing`, not `datum/thing`
|
||||
|
||||
Reference in New Issue
Block a user