@@ -155,23 +155,23 @@ byte P_CheckMeleeRange(mobj_t *actor)
155
155
//
156
156
// P_CheckMissileRange
157
157
//
158
- byte P_CheckMissileRange (mobj_t * actor )
158
+ byte P_NotCheckMissileRange (mobj_t * actor )
159
159
{
160
160
fixed_t dist ;
161
161
162
162
if (!P_CheckSight (actor , actor -> target ))
163
- return 0 ;
163
+ return 1 ;
164
164
165
165
if (actor -> flags & MF_JUSTHIT )
166
166
{
167
167
// the target just hit the enemy,
168
168
// so fight back!
169
169
actor -> flags &= ~MF_JUSTHIT ;
170
- return 1 ;
170
+ return 0 ;
171
171
}
172
172
173
173
if (actor -> reactiontime )
174
- return 0 ; // do not attack yet
174
+ return 1 ; // do not attack yet
175
175
176
176
// OPTIMIZE: get this from a global checksight
177
177
dist = P_AproxDistance (actor -> x - actor -> target -> x , actor -> y - actor -> target -> y ) - 64 * FRACUNIT ;
@@ -183,13 +183,13 @@ byte P_CheckMissileRange(mobj_t *actor)
183
183
184
184
if (actor -> type == MT_VILE && dist > 14 * 64 )
185
185
{
186
- return 0 ; // too far away
186
+ return 1 ; // too far away
187
187
}
188
188
189
189
if (actor -> type == MT_UNDEAD )
190
190
{
191
191
if (dist < 196 )
192
- return 0 ; // close for fist attack
192
+ return 1 ; // close for fist attack
193
193
dist >>= 1 ;
194
194
}
195
195
@@ -201,7 +201,7 @@ byte P_CheckMissileRange(mobj_t *actor)
201
201
if (actor -> type == MT_CYBORG && dist > 160 )
202
202
dist = 160 ;
203
203
204
- return P_Random >= dist ;
204
+ return P_Random < dist ;
205
205
}
206
206
207
207
//
@@ -214,7 +214,7 @@ byte P_CheckMissileRange(mobj_t *actor)
214
214
extern line_t * spechit [MAXSPECIALCROSS ];
215
215
extern int numspechit ;
216
216
217
- byte P_Move (mobj_t * actor )
217
+ byte P_NotMove (mobj_t * actor )
218
218
{
219
219
fixed_t tryx ;
220
220
fixed_t tryy ;
@@ -223,8 +223,7 @@ byte P_Move(mobj_t *actor)
223
223
224
224
// warning: 'catch', 'throw', and 'try'
225
225
// are all C++ reserved words
226
- byte good ;
227
-
226
+
228
227
fixed_t optSpeed ;
229
228
230
229
switch (actor -> movedir )
@@ -266,11 +265,13 @@ byte P_Move(mobj_t *actor)
266
265
tryy = actor -> y - optSpeed ;
267
266
break ;
268
267
case DI_NODIR :
269
- return 0 ;
268
+ return 1 ;
270
269
}
271
270
272
271
if (P_TryMove (actor , tryx , tryy ))
273
272
{
273
+ byte good ;
274
+
274
275
// open any specials
275
276
if (actor -> flags & MF_FLOAT && floatok )
276
277
{
@@ -281,22 +282,22 @@ byte P_Move(mobj_t *actor)
281
282
actor -> z -= FLOATSPEED ;
282
283
283
284
actor -> flags |= MF_INFLOAT ;
284
- return 1 ;
285
+ return 0 ;
285
286
}
286
287
287
288
if (!numspechit )
288
- return 0 ;
289
+ return 1 ;
289
290
290
291
actor -> movedir = DI_NODIR ;
291
- good = 0 ;
292
+ good = 1 ;
292
293
while (numspechit -- )
293
294
{
294
295
ld = spechit [numspechit ];
295
296
// if the special is not a door
296
297
// that can be opened,
297
298
// return false
298
299
if (P_UseSpecialLine (actor , ld , 0 ))
299
- good = 1 ;
300
+ good = 0 ;
300
301
}
301
302
return good ;
302
303
}
@@ -308,7 +309,7 @@ byte P_Move(mobj_t *actor)
308
309
if (!(actor -> flags & MF_FLOAT ))
309
310
actor -> z = actor -> floorz ;
310
311
311
- return 1 ;
312
+ return 0 ;
312
313
}
313
314
314
315
//
@@ -324,7 +325,7 @@ byte P_Move(mobj_t *actor)
324
325
//
325
326
byte P_TryWalk (mobj_t * actor )
326
327
{
327
- if (! P_Move (actor ))
328
+ if (P_NotMove (actor ))
328
329
{
329
330
return 0 ;
330
331
}
@@ -618,7 +619,7 @@ void A_Look(mobj_t *actor)
618
619
S_StartSound (actor , sound );
619
620
}
620
621
621
- P_SetMobjState (actor , actor -> info -> seestate );
622
+ P_NotSetMobjState (actor , actor -> info -> seestate );
622
623
}
623
624
624
625
//
@@ -661,7 +662,7 @@ void A_Chase(mobj_t *actor)
661
662
if (P_LookForPlayersAllAround (actor ))
662
663
return ; // got a new target
663
664
664
- P_SetMobjState (actor , actor -> info -> spawnstate );
665
+ P_NotSetMobjState (actor , actor -> info -> spawnstate );
665
666
return ;
666
667
}
667
668
@@ -680,7 +681,7 @@ void A_Chase(mobj_t *actor)
680
681
if (actor -> info -> attacksound )
681
682
S_StartSound (actor , actor -> info -> attacksound );
682
683
683
- P_SetMobjState (actor , actor -> info -> meleestate );
684
+ P_NotSetMobjState (actor , actor -> info -> meleestate );
684
685
return ;
685
686
}
686
687
@@ -690,10 +691,10 @@ void A_Chase(mobj_t *actor)
690
691
if (gameskill < sk_nightmare && !fastparm && actor -> movecount )
691
692
goto nomissile ;
692
693
693
- if (! P_CheckMissileRange (actor ))
694
+ if (P_NotCheckMissileRange (actor ))
694
695
goto nomissile ;
695
696
696
- P_SetMobjState (actor , actor -> info -> missilestate );
697
+ P_NotSetMobjState (actor , actor -> info -> missilestate );
697
698
actor -> flags |= MF_JUSTATTACKED ;
698
699
return ;
699
700
}
@@ -702,7 +703,7 @@ void A_Chase(mobj_t *actor)
702
703
nomissile :
703
704
704
705
// chase towards player
705
- if (-- actor -> movecount < 0 || ! P_Move (actor ))
706
+ if (-- actor -> movecount < 0 || P_NotMove (actor ))
706
707
{
707
708
P_NewChaseDir (actor );
708
709
}
@@ -810,7 +811,7 @@ void A_CPosRefire(mobj_t *actor)
810
811
return ;
811
812
812
813
if (!actor -> target || actor -> target -> health <= 0 || !P_CheckSight (actor , actor -> target ))
813
- P_SetMobjState (actor , actor -> info -> seestate );
814
+ P_NotSetMobjState (actor , actor -> info -> seestate );
814
815
}
815
816
816
817
void A_SpidRefire (mobj_t * actor )
@@ -823,7 +824,7 @@ void A_SpidRefire(mobj_t *actor)
823
824
824
825
if (!actor -> target || actor -> target -> health <= 0 || !P_CheckSight (actor , actor -> target ))
825
826
{
826
- P_SetMobjState (actor , actor -> info -> seestate );
827
+ P_NotSetMobjState (actor , actor -> info -> seestate );
827
828
}
828
829
}
829
830
@@ -1072,10 +1073,10 @@ byte PIT_VileCheck(mobj_t *thing)
1072
1073
corpsehit = thing ;
1073
1074
corpsehit -> momx = corpsehit -> momy = 0 ;
1074
1075
corpsehit -> height <<= 2 ;
1075
- check = P_CheckPosition (corpsehit , corpsehit -> x , corpsehit -> y );
1076
+ check = P_NotCheckPosition (corpsehit , corpsehit -> x , corpsehit -> y );
1076
1077
corpsehit -> height >>= 2 ;
1077
1078
1078
- return ! check ;
1079
+ return check ;
1079
1080
}
1080
1081
1081
1082
//
@@ -1153,19 +1154,19 @@ void A_VileChase(mobj_t *actor)
1153
1154
// Call PIT_VileCheck to check
1154
1155
// whether object is a corpse
1155
1156
// that canbe raised.
1156
- if (! P_BlockThingsIterator (bx , by , PIT_VileCheck ))
1157
+ if (P_NotBlockThingsIterator (bx , by , PIT_VileCheck ))
1157
1158
{
1158
1159
// got one!
1159
1160
temp = actor -> target ;
1160
1161
actor -> target = corpsehit ;
1161
1162
A_FaceTarget (actor );
1162
1163
actor -> target = temp ;
1163
1164
1164
- P_SetMobjState (actor , S_VILE_HEAL1 );
1165
+ P_NotSetMobjState (actor , S_VILE_HEAL1 );
1165
1166
S_StartSound (corpsehit , sfx_slop );
1166
1167
info = corpsehit -> info ;
1167
1168
1168
- P_SetMobjState (corpsehit , info -> raisestate );
1169
+ P_NotSetMobjState (corpsehit , info -> raisestate );
1169
1170
corpsehit -> height <<= 2 ;
1170
1171
corpsehit -> flags = info -> flags ;
1171
1172
corpsehit -> health = info -> spawnhealth ;
@@ -1798,7 +1799,7 @@ void A_BrainScream(mobj_t *mo)
1798
1799
th = P_SpawnMobj (x , y , z , MT_ROCKET );
1799
1800
th -> momz = P_Random * 512 ;
1800
1801
1801
- P_SetMobjState (th , S_BRAINEXPLODE1 );
1802
+ P_NotSetMobjState (th , S_BRAINEXPLODE1 );
1802
1803
1803
1804
th -> tics -= P_Random & 7 ;
1804
1805
if (th -> tics < 1 )
@@ -1821,7 +1822,7 @@ void A_BrainExplode(mobj_t *mo)
1821
1822
th = P_SpawnMobj (x , y , z , MT_ROCKET );
1822
1823
th -> momz = P_Random * 512 ;
1823
1824
1824
- P_SetMobjState (th , S_BRAINEXPLODE1 );
1825
+ P_NotSetMobjState (th , S_BRAINEXPLODE1 );
1825
1826
1826
1827
th -> tics -= P_Random & 7 ;
1827
1828
if (th -> tics < 1 )
@@ -1913,7 +1914,7 @@ void A_SpawnFly(mobj_t *mo)
1913
1914
1914
1915
newmobj = P_SpawnMobj (targ -> x , targ -> y , targ -> z , type );
1915
1916
if (P_LookForPlayersAllAround (newmobj ))
1916
- P_SetMobjState (newmobj , newmobj -> info -> seestate );
1917
+ P_NotSetMobjState (newmobj , newmobj -> info -> seestate );
1917
1918
1918
1919
// telefrag anything in this spot
1919
1920
P_TeleportMove (newmobj , newmobj -> x , newmobj -> y );
0 commit comments