MCPcopy Create free account
hub / github.com/diasurgical/devilution / DRLG_L3CreateBlock

Function DRLG_L3CreateBlock

Source/drlg_l3.cpp:136–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136static void DRLG_L3CreateBlock(int x, int y, int obs, int dir)
137{
138 int blksizex, blksizey, x1, y1, x2, y2;
139 BOOL contflag;
140
141 blksizex = random_(0, 2) + 3;
142 blksizey = random_(0, 2) + 3;
143
144 if (dir == 0) {
145 y2 = y - 1;
146 y1 = y2 - blksizey;
147 if (blksizex < obs) {
148 x1 = random_(0, blksizex) + x;
149 }
150 if (blksizex == obs) {
151 x1 = x;
152 }
153 if (blksizex > obs) {
154 x1 = x - random_(0, blksizex);
155 }
156 x2 = blksizex + x1;
157 }
158 if (dir == 3) {
159 x2 = x - 1;
160 x1 = x2 - blksizex;
161 if (blksizey < obs) {
162 y1 = random_(0, blksizey) + y;
163 }
164 if (blksizey == obs) {
165 y1 = y;
166 }
167 if (blksizey > obs) {
168 y1 = y - random_(0, blksizey);
169 }
170 y2 = y1 + blksizey;
171 }
172 if (dir == 2) {
173 y1 = y + 1;
174 y2 = y1 + blksizey;
175 if (blksizex < obs) {
176 x1 = random_(0, blksizex) + x;
177 }
178 if (blksizex == obs) {
179 x1 = x;
180 }
181 if (blksizex > obs) {
182 x1 = x - random_(0, blksizex);
183 }
184 x2 = blksizex + x1;
185 }
186 if (dir == 1) {
187 x1 = x + 1;
188 x2 = x1 + blksizex;
189 if (blksizey < obs) {
190 y1 = random_(0, blksizey) + y;
191 }
192 if (blksizey == obs) {
193 y1 = y;

Callers 1

DRLG_L3Function · 0.85

Calls 2

random_Function · 0.85
DRLG_L3FillRoomFunction · 0.85

Tested by

no test coverage detected