MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SetALValue

Method SetALValue

Descent3/aiambient.cpp:74–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void ambient_life::SetALValue(char i, char field, void *ptr) {
75 switch (field) {
76 case ALI_TYPE:
77 m_type[i] = *((int *)ptr);
78 break;
79 case ALI_TOTAL:
80 m_total[i] = *((uint8_t *)ptr);
81 break;
82 case ALI_MAX:
83 m_max[i] = *((uint8_t *)ptr);
84 break;
85 case ALI_MIN:
86 m_min[i] = *((uint8_t *)ptr);
87 break;
88 case ALI_FLAGS:
89 m_flags[i] = *((uint8_t *)ptr);
90 break;
91 }
92
93 // Jeff(Linux): Commented out because m_total[] is unsigned, so never negative
94 // if(m_total[i] < 0)
95 // m_total[i] = 0;
96 if (m_total[i] > MAX_ALS_PER_TYPE)
97 m_total[i] = MAX_ALS_PER_TYPE;
98
99 // Jeff(Linux): Commented out because m_max[] is unsigned, so never negative
100 // if(m_max[i] < 0)
101 // m_max[i] = 0;
102 if (m_max[i] > m_total[i])
103 m_max[i] = m_total[i];
104
105 // Jeff(Linux): Commented out because m_min[] is unsigned, so never negative
106 // if(m_min[i] < 0)
107 // m_min[i] = 0;
108 if (m_min[i] > m_max[i])
109 m_min[i] = m_max[i];
110
111 ComputeNextSize(i);
112}
113
114void ambient_life::ALReset() {
115 int i;

Callers 8

SetAmbTypeMethod · 0.80
SetAmbCharValMethod · 0.80
OnAmbOutside1Method · 0.80
OnAmbOutside2Method · 0.80
OnAmbOutside3Method · 0.80
OnAmbOutside4Method · 0.80
OnAmbOutside5Method · 0.80
OnAmbOutside6Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected