Changes

Jump to navigation Jump to search
m
Text replacement - "i.e. " to "''i.e.,'' "
Line 85: Line 85:  
Your code is referencing a [[Modding:Modder Guide/Game Fundamentals#Net fields|net field]], which can cause subtle bugs. You should access the underlying value instead:
 
Your code is referencing a [[Modding:Modder Guide/Game Fundamentals#Net fields|net field]], which can cause subtle bugs. You should access the underlying value instead:
 
<ul>
 
<ul>
<li>For a reference type (i.e. one that can contain <samp>null</samp>), you can use the <samp>.Value</samp> property (or <samp>.FieldDict</samp> for a <samp>NetDictionary</samp>):
+
<li>For a reference type (''i.e.,'' one that can contain <samp>null</samp>), you can use the <samp>.Value</samp> property (or <samp>.FieldDict</samp> for a <samp>NetDictionary</samp>):
 
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
 
if (building.indoors.Value == null)
 
if (building.indoors.Value == null)
Line 96: Line 96:  
   // ...
 
   // ...
 
</syntaxhighlight></li>
 
</syntaxhighlight></li>
<li>For a value type (i.e. one that can't contain <samp>null</samp>), check if the parent is null (if needed) and compare with <samp>.Value</samp>:
+
<li>For a value type (''i.e.,'' one that can't contain <samp>null</samp>), check if the parent is null (if needed) and compare with <samp>.Value</samp>:
 
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
 
if (item != null && item.category.Value == 0)
 
if (item != null && item.category.Value == 0)
105,560

edits

Navigation menu