Skip to content

Commit 56adcff

Browse files
committed
Fix security offices #141
1 parent 4825e5a commit 56adcff

File tree

5 files changed

+54
-3
lines changed

5 files changed

+54
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ This resource has been completely rewritten from scratch since v2.0. You can cus
3030
(DD/MM/YYYY)
3131

3232
---
33+
29/07/2024 - 2.3.1
34+
- Fix world not rendering when inside security offices
35+
3336
02/07/2024 - 2.3.0
3437
- Added "Bottom Dollar Bounties" support
3538

fxmanifest.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ game 'gta5'
33

44
author 'Bob_74'
55
description 'Load and customize your map'
6-
version '2.3.0'
6+
version '2.3.1'
77

88
lua54 "yes"
99

1010
client_scripts {
1111
"lib/common.lua"
1212
, "lib/observers/interiorIdObserver.lua"
1313
, "lib/observers/officeSafeDoorHandler.lua"
14+
, "lib/observers/officeCullHandler.lua"
1415
, "client.lua"
1516

1617
-- GTA V

lib/common.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ Global = {
3535
isInsideApartment5 = false,
3636
isInsideApartment6 = false
3737
},
38+
Security = {
39+
isInsideOffice1 = false,
40+
isInsideOffice2 = false,
41+
isInsideOffice3 = false,
42+
isInsideOffice4 = false
43+
},
3844

3945
-- Set all interiors variables to false
4046
-- The loop inside 'interiorIdObserver' will set them to true
4147
ResetInteriorVariables = function()
42-
for _, parentKey in pairs{"Biker", "FinanceOffices", "HighLife"} do
48+
for _, parentKey in pairs{"Biker", "FinanceOffices", "HighLife", "Security"} do
4349
local t = Global[parentKey]
4450

4551
for key in pairs(t) do

lib/observers/interiorIdObserver.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local _scanDelay = 500
33
Citizen.CreateThread(function()
44
while true do
55
-- /!\ To do: Find a more reliable way to get the current interior ID
6-
Global.currentInteriorId = GetInteriorAtCoords(GetEntityCoords(PlayerPedId()))
6+
Global.currentInteriorId = GetInteriorFromEntity(PlayerPedId())
77

88
if Global.currentInteriorId == 0 then
99
Global.ResetInteriorVariables()
@@ -41,6 +41,12 @@ Citizen.CreateThread(function()
4141
Global.FinanceOffices.isInsideOffice2 = (Global.currentInteriorId == FinanceOffice2.currentInteriorId)
4242
Global.FinanceOffices.isInsideOffice3 = (Global.currentInteriorId == FinanceOffice3.currentInteriorId)
4343
Global.FinanceOffices.isInsideOffice4 = (Global.currentInteriorId == FinanceOffice4.currentInteriorId)
44+
45+
-- DLC: The Contract
46+
Global.Security.isInsideOffice1 = (Global.currentInteriorId == MpSecurityOffice1.InteriorId)
47+
Global.Security.isInsideOffice2 = (Global.currentInteriorId == MpSecurityOffice2.InteriorId)
48+
Global.Security.isInsideOffice3 = (Global.currentInteriorId == MpSecurityOffice3.InteriorId)
49+
Global.Security.isInsideOffice4 = (Global.currentInteriorId == MpSecurityOffice4.InteriorId)
4450
end
4551

4652
Citizen.Wait(_scanDelay)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
CreateThread(function()
2+
while true do
3+
if Global.Security.isInsideOffice1 then
4+
EnableExteriorCullModelThisFrame(`bh1_05_build1`)
5+
EnableExteriorCullModelThisFrame(`bh1_05_em`)
6+
7+
DisableOcclusionThisFrame()
8+
end
9+
10+
if Global.Security.isInsideOffice2 then
11+
EnableExteriorCullModelThisFrame(`hei_hw1_08_hotplaz01`)
12+
EnableExteriorCullModelThisFrame(`hw1_08_hotplaz_rail`)
13+
EnableExteriorCullModelThisFrame(`hw1_08_emissive_c`)
14+
15+
DisableOcclusionThisFrame()
16+
end
17+
18+
if Global.Security.isInsideOffice3 then
19+
EnableExteriorCullModelThisFrame(`hei_kt1_05_01`)
20+
EnableExteriorCullModelThisFrame(`kt1_05_glue_b`)
21+
EnableExteriorCullModelThisFrame(`kt1_05_kt_emissive_kt1_05`)
22+
23+
DisableOcclusionThisFrame()
24+
end
25+
26+
if Global.Security.isInsideOffice4 then
27+
EnableExteriorCullModelThisFrame(`hei_kt1_08_buildingtop_a`)
28+
EnableExteriorCullModelThisFrame(`hei_kt1_08_kt1_emissive_ema`)
29+
30+
DisableOcclusionThisFrame()
31+
end
32+
33+
Wait(0)
34+
end
35+
end)

0 commit comments

Comments
 (0)