forked from root-cause/v-decompiled-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
am_doors.c
5604 lines (4850 loc) · 98.3 KB
/
am_doors.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#region Local Var
var uLocal_0 = 0;
var uLocal_1 = 0;
int iLocal_2 = 0;
int iLocal_3 = 0;
int iLocal_4 = 0;
int iLocal_5 = 0;
int iLocal_6 = 0;
int iLocal_7 = 0;
int iLocal_8 = 0;
int iLocal_9 = 0;
int iLocal_10 = 0;
int iLocal_11 = 0;
float fLocal_12 = 0f;
var uLocal_13 = 0;
var uLocal_14 = 0;
int iLocal_15 = 0;
char* sLocal_16 = NULL;
var uLocal_17 = 0;
var uLocal_18 = 0;
var uLocal_19 = 0;
var uLocal_20 = 0;
float fLocal_21 = 0f;
float fLocal_22 = 0f;
float fLocal_23 = 0f;
var uLocal_24 = 0;
var uLocal_25 = 0;
float fLocal_26 = 0f;
var uLocal_27 = 0;
var uLocal_28 = 0;
var uLocal_29 = 0;
float fLocal_30 = 0f;
float fLocal_31 = 0f;
var uLocal_32 = 0;
var uLocal_33 = 0;
int iLocal_34 = 0;
var uLocal_35 = 0;
var uLocal_36 = 0;
var uLocal_37 = 0;
int iLocal_38 = 0;
int iLocal_39 = 0;
int iLocal_40 = 0;
int iLocal_41 = 0;
var uLocal_42 = 0;
var uLocal_43 = 0;
var uLocal_44 = 0;
var uLocal_45 = 0;
var uLocal_46 = 0;
var uLocal_47 = 0;
var uLocal_48 = 0;
var uLocal_49 = 0;
var uLocal_50 = 0;
var uLocal_51 = 0;
var uLocal_52 = 0;
var uLocal_53 = 0;
var uLocal_54 = 0;
var uLocal_55 = 0;
var uLocal_56 = 0;
var uLocal_57 = 0;
var uLocal_58 = 0;
var uLocal_59 = 0;
var uLocal_60 = 0;
var uLocal_61 = 0;
var uLocal_62 = 0;
var uLocal_63 = 0;
float fLocal_64 = 0f;
var uLocal_65 = 0;
var uLocal_66 = 0;
var uLocal_67 = 0;
var uLocal_68 = 0;
var uLocal_69 = 0;
var uLocal_70 = 0;
var uLocal_71 = 0;
var uLocal_72 = 0;
var uLocal_73 = 0;
var uLocal_74 = 0;
var uLocal_75 = 0;
var uLocal_76 = 0;
var uLocal_77 = 0;
var uLocal_78 = 0;
var uLocal_79 = 0;
var uLocal_80 = 0;
var uLocal_81 = 0;
var uLocal_82 = 0;
var uLocal_83 = 0;
var uLocal_84 = 0;
var uLocal_85 = 0;
var uLocal_86 = 0;
var uLocal_87 = 0;
var uLocal_88 = 0;
var uLocal_89 = 0;
var uLocal_90 = 0;
var uLocal_91 = -1;
var uLocal_92 = 0;
var uLocal_93 = 0;
var uLocal_94 = 0;
var uLocal_95 = 0;
var uLocal_96 = 0;
var uLocal_97 = 0;
var uLocal_98 = 0;
var uLocal_99 = 0;
var uLocal_100 = 0;
var uLocal_101 = 0;
var uLocal_102 = 0;
var uLocal_103 = 0;
var uLocal_104 = 0;
var uLocal_105 = 0;
var uLocal_106 = 0;
var uLocal_107 = 0;
var uLocal_108 = 0;
var uLocal_109 = 0;
var uLocal_110 = 0;
var uLocal_111 = 0;
var uLocal_112 = 0;
var uLocal_113 = 0;
var uLocal_114 = 0;
int iLocal_115 = 0;
var uLocal_116 = 0;
var uLocal_117 = 0;
int iLocal_118 = 0;
int iLocal_119 = 0;
int iLocal_120 = 0;
int iLocal_121 = 0;
int iLocal_122 = 0;
int iLocal_123 = 0;
struct<17> Local_124[6];
int iLocal_227 = 0;
bool bLocal_228 = 0;
int iLocal_229 = 0;
struct<10> Local_230 = { 0, 0, 6, 0, 0, 0, 0, 0, 0, 6 } ;
var uLocal_240 = 0;
var uLocal_241 = 0;
var uLocal_242 = 0;
var uLocal_243 = 0;
var uLocal_244 = 0;
var uLocal_245 = 0;
var uLocal_246 = 0;
var uLocal_247 = 1;
var uLocal_248 = 0;
var uLocal_249 = 0;
var uLocal_250 = 0;
var uLocal_251 = 0;
var uLocal_252 = 0;
var uLocal_253 = 0;
var uLocal_254 = 0;
var uLocal_255 = 0;
var uLocal_256 = 0;
var uLocal_257 = 0;
var uLocal_258 = 0;
var uLocal_259 = 0;
int iLocal_260[6] = { 0, 0, 0, 0, 0, 0 };
struct<2> Local_267[6];
struct<4> Local_280[32];
float fLocal_409[4] = { 0f, 0f, 0f, 0f };
struct<21> ScriptParam_0 = { 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1 } ;
#endregion
void __EntryFunction__()//Position - 0x0
{
iLocal_2 = 1;
iLocal_3 = 134;
iLocal_4 = 134;
iLocal_5 = 1;
iLocal_6 = 1;
iLocal_7 = 1;
iLocal_8 = 134;
iLocal_9 = 1;
iLocal_10 = 12;
iLocal_11 = 12;
fLocal_12 = 0.001f;
iLocal_15 = -1;
sLocal_16 = "NULL";
fLocal_21 = 80f;
fLocal_22 = 140f;
fLocal_23 = 180f;
fLocal_26 = 0f;
fLocal_30 = -0.0375f;
fLocal_31 = 0.17f;
iLocal_34 = 3;
iLocal_38 = 1;
iLocal_39 = 65;
iLocal_40 = 49;
iLocal_41 = 64;
fLocal_64 = ((0.05f + 0.275f) - 0.01f);
iLocal_115 = 15;
if (func_73())
{
func_71();
}
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS())
{
if (!func_60(ScriptParam_0))
{
func_71();
}
}
if (iLocal_115 == 15)
{
}
iLocal_123 = 0;
func_58();
while (true)
{
func_57();
if (func_73())
{
func_71();
}
if (NETWORK::NETWORK_IS_IN_TUTORIAL_SESSION())
{
if (NETWORK::NETWORK_GET_PLAYER_TUTORIAL_SESSION_INSTANCE(PLAYER::PLAYER_ID()) == 32)
{
if (ScriptParam_0.f_16 != (50 + PLAYER::PLAYER_ID()))
{
func_56(2);
}
}
else if (ScriptParam_0.f_16 != NETWORK::NETWORK_GET_PLAYER_TUTORIAL_SESSION_INSTANCE(PLAYER::PLAYER_ID()))
{
func_56(2);
}
}
else if (ScriptParam_0.f_16 != -1)
{
func_56(2);
}
func_55(&uLocal_116, 0, 0);
switch (func_54(NETWORK::PARTICIPANT_ID_TO_INT()))
{
case 0:
if (Global_4718592 == 2)
{
iLocal_122 = 98;
}
else
{
iLocal_122 = 99;
}
if ((!Global_38736 && func_53() != -1) && func_53() != 999)
{
if (!iLocal_118)
{
if (func_52(&iLocal_123, iLocal_122))
{
iLocal_118 = 1;
iLocal_123 = 0;
}
}
else if (!iLocal_120)
{
if (!iLocal_119)
{
if (func_50(&iLocal_123, iLocal_122))
{
iLocal_123 = 0;
iLocal_119 = 1;
}
}
else if (func_48(&iLocal_123, iLocal_122))
{
iLocal_123 = 0;
iLocal_120 = 1;
}
}
else if (func_47() >= 2)
{
func_56(1);
}
}
break;
case 1:
func_44();
Global_2794162.f_4607 = 1;
func_35();
func_9();
break;
case 2:
func_71();
break;
}
if (NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT())
{
switch (func_47())
{
case 0:
func_8(2);
break;
case 2:
if (func_54(NETWORK::PARTICIPANT_ID_TO_INT()) == 1)
{
func_1();
}
break;
case 3:
break;
case 4:
break;
}
}
}
}
void func_1()//Position - 0x24B
{
bLocal_228 = false;
bLocal_228 = false;
while (bLocal_228 < 6)
{
if (func_7(PLAYER::INT_TO_PLAYERINDEX(iLocal_227), 0, 1))
{
if (BitTest(Local_280[iLocal_227 /*4*/].f_2, bLocal_228))
{
MISC::SET_BIT(&(Local_230.f_2[bLocal_228]), iLocal_227);
}
else
{
MISC::CLEAR_BIT(&(Local_230.f_2[bLocal_228]), iLocal_227);
}
}
else
{
MISC::CLEAR_BIT(&(Local_230.f_9[bLocal_228]), iLocal_227);
MISC::CLEAR_BIT(&(Local_230.f_9[bLocal_228]), iLocal_227);
}
if (Local_230.f_9[bLocal_228] != 0)
{
if (Local_124[bLocal_228 /*17*/][0] != 0)
{
func_2(bLocal_228, Local_124[bLocal_228 /*17*/][0], 5);
}
if (Local_124[bLocal_228 /*17*/][1] != 0)
{
func_2(bLocal_228, Local_124[bLocal_228 /*17*/][1], 5);
}
}
else if (Local_230.f_2[bLocal_228] != 0)
{
if (Local_124[bLocal_228 /*17*/][0] != 0)
{
func_2(bLocal_228, Local_124[bLocal_228 /*17*/][0], 0);
}
if (Local_124[bLocal_228 /*17*/][1] != 0)
{
func_2(bLocal_228, Local_124[bLocal_228 /*17*/][1], 0);
}
}
else
{
if (Local_124[bLocal_228 /*17*/][0] != 0)
{
func_2(bLocal_228, Local_124[bLocal_228 /*17*/][0], 1);
}
if (Local_124[bLocal_228 /*17*/][1] != 0)
{
func_2(bLocal_228, Local_124[bLocal_228 /*17*/][1], 1);
}
}
bLocal_228++;
}
iLocal_227++;
if (iLocal_227 >= 32)
{
iLocal_227 = 0;
}
}
void func_2(bool bParam0, int iParam1, int iParam2)//Position - 0x3A0
{
int iVar0;
iVar0 = 1;
if (iParam2 == 0)
{
iVar0 = 0;
}
if (iLocal_260[bParam0] == 0)
{
if (OBJECT::DOOR_SYSTEM_GET_DOOR_PENDING_STATE(iParam1) == -1)
{
if (OBJECT::DOOR_SYSTEM_GET_DOOR_STATE(iParam1) != iParam2)
{
if (NETWORK::NETWORK_HAS_CONTROL_OF_DOOR(iParam1))
{
MISC::SET_BIT(&(iLocal_260[bParam0]), iVar0);
OBJECT::DOOR_SYSTEM_SET_DOOR_STATE(iParam1, iParam2, true, true);
func_55(&(Local_267[bParam0 /*2*/]), 1, 0);
}
else
{
NETWORK::NETWORK_REQUEST_CONTROL_OF_DOOR(iParam1);
}
}
}
else if (OBJECT::DOOR_SYSTEM_GET_DOOR_PENDING_STATE(iParam1) != iParam2)
{
if (NETWORK::NETWORK_HAS_CONTROL_OF_DOOR(iParam1))
{
MISC::SET_BIT(&(iLocal_260[bParam0]), iVar0);
OBJECT::DOOR_SYSTEM_SET_DOOR_STATE(iParam1, iParam2, true, true);
func_55(&(Local_267[bParam0 /*2*/]), 1, 0);
}
else
{
NETWORK::NETWORK_REQUEST_CONTROL_OF_DOOR(iParam1);
}
}
}
if (func_6(&(Local_267[bParam0 /*2*/])))
{
if (func_4(&(Local_267[bParam0 /*2*/]), 1000, 1))
{
func_3(&(Local_267[bParam0 /*2*/]));
iLocal_260[bParam0] = 0;
}
}
}
void func_3(var uParam0)//Position - 0x483
{
uParam0->f_1 = 0;
}
int func_4(var uParam0, int iParam1, bool bParam2)//Position - 0x490
{
if (iParam1 == -1)
{
return 1;
}
func_5(uParam0, bParam2, 0);
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !bParam2)
{
if (MISC::ABSI(NETWORK::GET_TIME_DIFFERENCE(NETWORK::GET_NETWORK_TIME(), *uParam0)) >= iParam1)
{
return 1;
}
}
else if (MISC::ABSI(NETWORK::GET_TIME_DIFFERENCE(MISC::GET_GAME_TIMER(), *uParam0)) >= iParam1)
{
return 1;
}
return 0;
}
void func_5(var uParam0, bool bParam1, bool bParam2)//Position - 0x4EE
{
if (uParam0->f_1 == 0)
{
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !bParam1)
{
if (!bParam2)
{
*uParam0 = NETWORK::GET_NETWORK_TIME();
}
else
{
*uParam0 = NETWORK::GET_NETWORK_TIME_ACCURATE();
}
}
else
{
*uParam0 = MISC::GET_GAME_TIMER();
}
uParam0->f_1 = 1;
}
}
bool func_6(var uParam0)//Position - 0x533
{
return uParam0->f_1;
}
int func_7(int iParam0, bool bParam1, bool bParam2)//Position - 0x53F
{
int iVar0;
iVar0 = iParam0;
if (iVar0 != -1)
{
if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(iParam0))
{
if (bParam1)
{
if (!PLAYER::IS_PLAYER_PLAYING(iParam0))
{
return 0;
}
}
if (bParam2)
{
if (iVar0 == Global_2672524.f_3)
{
return Global_2672524.f_2;
}
else if (Global_2657704[iVar0 /*463*/] != 4)
{
return 0;
}
}
return 1;
}
}
return 0;
}
void func_8(int iParam0)//Position - 0x59F
{
Local_230.f_0 = iParam0;
}
void func_9()//Position - 0x5AB
{
float fVar0;
struct<3> Var1;
Var1 = { func_34(PLAYER::PLAYER_ID()) };
fVar0 = SYSTEM::VDIST(Var1, Local_124[iLocal_229 /*17*/].f_3);
if ((BitTest(Global_2803781, iLocal_229) || BitTest(Global_2803781.f_1, iLocal_229)) || BitTest(Global_2803781.f_2, iLocal_229))
{
if (BitTest(Global_2803781, iLocal_229))
{
MISC::SET_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2), iLocal_229);
}
if (BitTest(Global_2803781.f_1, iLocal_229))
{
MISC::CLEAR_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2), iLocal_229);
}
if (BitTest(Global_2803781.f_2, iLocal_229))
{
MISC::SET_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_3), iLocal_229);
}
}
else if (fVar0 <= 20f)
{
if (OBJECT::IS_POINT_IN_ANGLED_AREA(Var1, Local_124[iLocal_229 /*17*/].f_3, Local_124[iLocal_229 /*17*/].f_6, Local_124[iLocal_229 /*17*/].f_9, false, true))
{
if (!BitTest(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2, iLocal_229))
{
MISC::SET_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2), iLocal_229);
}
}
if ((iLocal_229 == 0 || iLocal_229 == 1) || iLocal_229 == 5)
{
if (Global_2696135 || !func_13())
{
if (OBJECT::IS_POINT_IN_ANGLED_AREA(Var1, Local_124[iLocal_229 /*17*/].f_10, Local_124[iLocal_229 /*17*/].f_13, Local_124[iLocal_229 /*17*/].f_16, false, true))
{
if (!BitTest(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2, iLocal_229))
{
MISC::SET_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2), iLocal_229);
}
}
}
}
if ((iLocal_229 == 2 || iLocal_229 == 3) || iLocal_229 == 4)
{
if (func_11() >= 0)
{
if (func_10(29))
{
if (!BitTest(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2, iLocal_229))
{
MISC::SET_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2), iLocal_229);
}
}
else if (BitTest(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2, iLocal_229) && !OBJECT::IS_POINT_IN_ANGLED_AREA(Var1, Local_124[iLocal_229 /*17*/].f_3, Local_124[iLocal_229 /*17*/].f_6, Local_124[iLocal_229 /*17*/].f_9, false, true))
{
MISC::CLEAR_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2), iLocal_229);
}
}
}
}
else if (BitTest(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2, iLocal_229))
{
MISC::CLEAR_BIT(&(Local_280[PLAYER::PLAYER_ID() /*4*/].f_2), iLocal_229);
}
iLocal_229++;
if (iLocal_229 >= 6)
{
iLocal_229 = 0;
}
}
bool func_10(int iParam0)//Position - 0x7F7
{
if (iParam0 < 32)
{
return BitTest(Global_2672524.f_62.f_1, iParam0);
}
return BitTest(Global_2672524.f_62.f_2, (iParam0 - 32));
}
int func_11()//Position - 0x825
{
if (Global_2359296[func_12() /*5568*/].f_681.f_2 >= 415)
{
Global_2359296[func_12() /*5568*/].f_681.f_2 = -1;
return -1;
}
return Global_2359296[func_12() /*5568*/].f_681.f_2;
}
int func_12()//Position - 0x868
{
int iVar0;
iVar0 = 0;
return iVar0;
}
int func_13()//Position - 0x875
{
if (Global_1963787)
{
return 1;
}
if (func_29(PLAYER::PLAYER_ID(), 1) && !Global_1978333)
{
return 1;
}
if (func_27(PLAYER::PLAYER_ID()))
{
return 1;
}
if (func_20(PLAYER::PLAYER_ID()))
{
return 1;
}
if (func_16(PLAYER::PLAYER_ID()))
{
return 1;
}
if (func_14(156, -1))
{
return 0;
}
return 1;
}
bool func_14(int iParam0, int iParam1)//Position - 0x8DE
{
if (iParam1 == -1)
{
iParam1 = func_15();
}
return STATS::GET_PACKED_STAT_BOOL_CODE(iParam0, iParam1);
}
int func_15()//Position - 0x8FA
{
return Global_1574918;
}
int func_16(int iParam0)//Position - 0x906
{
if (func_19(iParam0))
{
return 1;
}
if (func_17(iParam0))
{
return 1;
}
return 0;
}
int func_17(int iParam0)//Position - 0x929
{
int iVar0;
iVar0 = iParam0;
if (iVar0 != -1)
{
return func_18(iParam0, 9);
}
return 0;
}
var func_18(int iParam0, int iParam1)//Position - 0x947
{
return BitTest(Global_1895156[iParam0 /*609*/].f_10.f_4, iParam1);
}
int func_19(var uParam0)//Position - 0x95F
{
int iVar0;
iVar0 = uParam0;
if (iVar0 != -1)
{
return BitTest(Global_1895156[iVar0 /*609*/].f_1, 0);
}
return 0;
}
bool func_20(int iParam0)//Position - 0x982
{
return func_21(func_22(iParam0));
}
int func_21(int iParam0)//Position - 0x994
{
switch (iParam0)
{
case 0:
case 1:
case 2:
case 3:
case 4:
return 1;
default:
}
return 0;
}
int func_22(int iParam0)//Position - 0x9C6
{
if (func_26(iParam0) == 256)
{
return func_23(iParam0);
}
return -1;
}
int func_23(int iParam0)//Position - 0x9E4
{
if (func_24(iParam0, 0))
{
return Global_1895156[iParam0 /*609*/].f_10.f_182;
}
return -1;
}
int func_24(int iParam0, int iParam1)//Position - 0xA07
{
if (func_25(iParam0))
{
if (Global_1895156[iParam0 /*609*/].f_10.f_33 != -1 || (iParam1 && Global_1895156[iParam0 /*609*/].f_10.f_32 != -1))
{
return 1;
}
}
return 0;
}
int func_25(var uParam0)//Position - 0xA4B
{
int iVar0;
iVar0 = uParam0;
if (iVar0 < 0)
{
return 0;
}
if (iVar0 >= 32)
{
return 0;
}
return 1;
}
int func_26(int iParam0)//Position - 0xA6D
{
if (func_25(iParam0))
{
if (func_24(iParam0, 0))
{
return Global_1895156[iParam0 /*609*/].f_10.f_33;
}
}
return -1;
}
int func_27(int iParam0)//Position - 0xA99
{
if (func_28(func_26(iParam0)))
{
return 1;
}
return 0;
}
int func_28(int iParam0)//Position - 0xAB3
{
switch (iParam0)
{
case 258:
return 1;
default:
}
return 0;
}
bool func_29(int iParam0, bool bParam1)//Position - 0xACD
{
if (func_53() != 0)
{
return func_33(iParam0) != 0;
}
return func_30(iParam0, bParam1, 0);
}
int func_30(int iParam0, bool bParam1, bool bParam2)//Position - 0xAF4
{
if (bParam1)
{
if (func_31(iParam0))
{
return 1;
}
}
if (!bParam2)
{
}
if (Global_1853988[iParam0 /*867*/] == -1)
{
return 0;
}
return 1;
}
bool func_31(int iParam0)//Position - 0xB26
{
return func_32(iParam0);
}
var func_32(int iParam0)//Position - 0xB34
{
return BitTest(Global_1853988[iParam0 /*867*/].f_11.f_1, 0);
}
int func_33(int iParam0)//Position - 0xB4B
{
if (func_7(iParam0, 0, 1))
{
return Global_2657704[iParam0 /*463*/].f_1;
}
return 0;
}
Vector3 func_34(int iParam0)//Position - 0xB6D
{
return ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED(iParam0), false);
}
void func_35()//Position - 0xB80
{
int iVar0;
int iVar1;
bool bVar2;
struct<13> Var3;
int iVar16;
Var3.f_4 = 2;
iVar0 = 0;
while (iVar0 < 4)
{
func_43(iVar0, &Var3);
if (MISC::GET_DISTANCE_BETWEEN_COORDS(func_34(PLAYER::PLAYER_ID()), Var3.f_1, true) < 150f)
{
bVar2 = false;
iVar1 = 0;
while (iVar1 < 32)
{
iVar16 = PLAYER::INT_TO_PLAYERINDEX(iVar1);
if (func_7(iVar16, 1, 1))
{
if (func_36(iVar16) && ENTITY::IS_ENTITY_IN_ANGLED_AREA(PLAYER::GET_PLAYER_PED(iVar16), Var3.f_4[0 /*3*/], Var3.f_4[1 /*3*/], Var3.f_11, false, true, 0))
{
bVar2 = true;
iVar1 = 32;
}
}
iVar1++;
}
if (bVar2)
{
if (fLocal_409[iVar0] != 1f)
{
fLocal_409[iVar0] = (fLocal_409[iVar0] + (Var3.f_12 * SYSTEM::TIMESTEP()));
if (fLocal_409[iVar0] > 1f)
{
fLocal_409[iVar0] = 1f;
}
AUDIO::SET_SCRIPT_UPDATE_DOOR_AUDIO(Var3.f_0, true);
OBJECT::DOOR_SYSTEM_SET_OPEN_RATIO(Var3.f_0, fLocal_409[iVar0], false, false);
OBJECT::DOOR_SYSTEM_SET_DOOR_STATE(Var3.f_0, 0, false, true);
}
}
else if (fLocal_409[iVar0] != 0f)
{
fLocal_409[iVar0] = (fLocal_409[iVar0] - (Var3.f_12 * SYSTEM::TIMESTEP()));
if (fLocal_409[iVar0] < 0f)
{
fLocal_409[iVar0] = 0f;
}
AUDIO::SET_SCRIPT_UPDATE_DOOR_AUDIO(Var3.f_0, true);
OBJECT::DOOR_SYSTEM_SET_OPEN_RATIO(Var3.f_0, fLocal_409[iVar0], false, false);
OBJECT::DOOR_SYSTEM_SET_DOOR_STATE(Var3.f_0, 1, false, true);
}
}
iVar0++;
}
}
int func_36(int iParam0)//Position - 0xCDE
{
int iVar0;
int iVar1;
int iVar2;
if (func_42(iParam0))
{
iVar0 = func_41(iParam0);
if ((iVar0 == 3 || iVar0 == 4) || iVar0 == 5)
{
return 1;
}
}
if (func_39(iParam0, 1))
{
iVar1 = func_38(iParam0);
if (iVar1 != func_37())
{
if (func_42(iVar1))
{
iVar2 = func_41(iVar1);
if ((iVar2 == 3 || iVar2 == 4) || iVar2 == 5)
{
return 1;
}
}
}
}
return 0;
}
int func_37()//Position - 0xD62
{
return -1;
}
int func_38(int iParam0)//Position - 0xD6B
{
if (func_25(iParam0))
{
return Global_1895156[iParam0 /*609*/].f_10;
}
return func_37();
}
bool func_39(int iParam0, bool bParam1)//Position - 0xD8E
{
if (!func_25(iParam0))
{
return 0;
}
if (!bParam1)
{
if (func_40(iParam0))
{
return 0;
}
}
return Global_1895156[iParam0 /*609*/].f_10 != func_37();
}
int func_40(int iParam0)//Position - 0xDC7
{
if (func_25(iParam0))
{
if (Global_1895156[iParam0 /*609*/].f_10 != func_37())
{
return Global_1895156[iParam0 /*609*/].f_10 == iParam0;
}
}
return 0;
}
int func_41(int iParam0)//Position - 0xDFC
{
if (iParam0 != func_37())
{
return Global_1853988[iParam0 /*867*/].f_267.f_293;
}
return 0;
}
int func_42(int iParam0)//Position - 0xE20
{
if (iParam0 != func_37())
{
return Global_1853988[iParam0 /*867*/].f_267.f_293 != 0;
}