Skip to content

Commit

Permalink
+ added set_restrictor_type and get_restrictor_type game_object metho…
Browse files Browse the repository at this point in the history
…ds 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),
	--]]
  • Loading branch information
revolucas authored and Xottab-DUTY committed Dec 23, 2017
1 parent e95b567 commit 3c95c3f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/xrGame/script_game_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ class CScriptGameObject
void IterateFeelTouch(luabind::functor<void> functor);
u32 GetSpatialType();
void SetSpatialType(u32 sptype);
u8 GetRestrictionType();
void SetRestrictionType(u8 type);

//Weapon
void Weapon_AddonAttach(CScriptGameObject* item);
Expand Down
20 changes: 20 additions & 0 deletions src/xrGame/script_game_object3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1534,5 +1534,25 @@ u32 CScriptGameObject::GetSpatialType()
{
return object().spatial.type;
}

u8 CScriptGameObject::GetRestrictionType()
{
CSpaceRestrictor* restr = smart_cast<CSpaceRestrictor*>(&object());
if (restr)
return restr->m_space_restrictor_type;

return -1;
}

void CScriptGameObject::SetRestrictionType(u8 type)
{
CSpaceRestrictor* restr = smart_cast<CSpaceRestrictor*>(&object());
if (restr)
{
restr->m_space_restrictor_type = type;
if (type != RestrictionSpace::eRestrictorTypeNone)
Level().space_restriction_manager().register_restrictor(restr, RestrictionSpace::ERestrictorTypes(type));
}
}
#endif
//-Alundaio
2 changes: 2 additions & 0 deletions src/xrGame/script_game_object_script3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ class_<CScriptGameObject>& script_register_game_object2(class_<CScriptGameObject
.enum_("CLSIDS")[value("no_pda_msg", int(ePdaMsgMax))]

// CustomZone
.def("set_restrictor_type", &CScriptGameObject::SetRestrictionType)
.def("get_restrictor_type", &CScriptGameObject::GetRestrictionType)
.def("enable_anomaly", &CScriptGameObject::EnableAnomaly)
.def("disable_anomaly", &CScriptGameObject::DisableAnomaly)
.def("get_anomaly_power", &CScriptGameObject::GetAnomalyPower)
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/space_restrictor.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CSpaceRestrictor : public CGameObject
mutable Fsphere m_selfbounds;
mutable bool m_actuality;

private:
public:
u8 m_space_restrictor_type;

private:
Expand Down

0 comments on commit 3c95c3f

Please sign in to comment.