Skip to content

Commit 3c95c3f

Browse files
revolucasXottab-DUTY
authored andcommitted
+ added set_restrictor_type and get_restrictor_type game_object methods ex.
anom:set_restrictor_type(4) anom:get_restrictor_type() --[[ eDefaultRestrictorTypeNone = u8(0), eDefaultRestrictorTypeOut = u8(1), eDefaultRestrictorTypeIn = u8(2), eRestrictorTypeNone = u8(3), eRestrictorTypeIn = u8(4), eRestrictorTypeOut = u8(5), --]]
1 parent e95b567 commit 3c95c3f

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/xrGame/script_game_object.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,8 @@ class CScriptGameObject
838838
void IterateFeelTouch(luabind::functor<void> functor);
839839
u32 GetSpatialType();
840840
void SetSpatialType(u32 sptype);
841+
u8 GetRestrictionType();
842+
void SetRestrictionType(u8 type);
841843

842844
//Weapon
843845
void Weapon_AddonAttach(CScriptGameObject* item);

src/xrGame/script_game_object3.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,5 +1534,25 @@ u32 CScriptGameObject::GetSpatialType()
15341534
{
15351535
return object().spatial.type;
15361536
}
1537+
1538+
u8 CScriptGameObject::GetRestrictionType()
1539+
{
1540+
CSpaceRestrictor* restr = smart_cast<CSpaceRestrictor*>(&object());
1541+
if (restr)
1542+
return restr->m_space_restrictor_type;
1543+
1544+
return -1;
1545+
}
1546+
1547+
void CScriptGameObject::SetRestrictionType(u8 type)
1548+
{
1549+
CSpaceRestrictor* restr = smart_cast<CSpaceRestrictor*>(&object());
1550+
if (restr)
1551+
{
1552+
restr->m_space_restrictor_type = type;
1553+
if (type != RestrictionSpace::eRestrictorTypeNone)
1554+
Level().space_restriction_manager().register_restrictor(restr, RestrictionSpace::ERestrictorTypes(type));
1555+
}
1556+
}
15371557
#endif
15381558
//-Alundaio

src/xrGame/script_game_object_script3.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ class_<CScriptGameObject>& script_register_game_object2(class_<CScriptGameObject
247247
.enum_("CLSIDS")[value("no_pda_msg", int(ePdaMsgMax))]
248248

249249
// CustomZone
250+
.def("set_restrictor_type", &CScriptGameObject::SetRestrictionType)
251+
.def("get_restrictor_type", &CScriptGameObject::GetRestrictionType)
250252
.def("enable_anomaly", &CScriptGameObject::EnableAnomaly)
251253
.def("disable_anomaly", &CScriptGameObject::DisableAnomaly)
252254
.def("get_anomaly_power", &CScriptGameObject::GetAnomalyPower)

src/xrGame/space_restrictor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CSpaceRestrictor : public CGameObject
4141
mutable Fsphere m_selfbounds;
4242
mutable bool m_actuality;
4343

44-
private:
44+
public:
4545
u8 m_space_restrictor_type;
4646

4747
private:

0 commit comments

Comments
 (0)