File tree Expand file tree Collapse file tree 7 files changed +17
-12
lines changed
Expand file tree Collapse file tree 7 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ public func Cast(value: Uint64) -> NodeRef = HashToNodeRef(value)
1313public func Cast(value: NodeRef) -> EntityID = EntityID.FromHash(NodeRefToHash(value))
1414public func Cast(value: EntityID) -> NodeRef = HashToNodeRef(EntityID.ToHash(value))
1515
16+ public func Cast(value: TweakDBID) -> Uint64 = TDBID.ToNumber(value)
17+ public func Cast(value: Uint64) -> TweakDBID = TDBID.FromNumber(value)
18+
1619public func Cast(value: String) -> NodeRef = CreateNodeRef(value)
1720
1821public func Cast(value: LocalizationString) -> String = ExtractLocalizationString(value)
File renamed without changes.
Original file line number Diff line number Diff line change 33
44bool App::EntityEx::ApplyMorphTarget (Red::CName aTarget, Red::CName aRegion, float aValue)
55{
6- for (const auto & component : GetComponents () )
6+ for (const auto & component : components )
77 {
88 if (component->GetType ()->IsA (Red::GetType<Red::entMorphTargetManagerComponent>()))
99 {
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ struct EntityEx : Red::Entity
88{
99 Red::ResourceAsyncReference<> GetTemplatePath ()
1010 {
11- return * Raw::Entity::TemplatePath ( this ) ;
11+ return templatePath ;
1212 }
1313
1414 Red::Handle<Red::IComponent> FindComponentByType (Red::CName aType)
1515 {
1616 if (auto type = Red::GetClass (aType))
1717 {
18- for (const auto & component : Raw::Entity::ComponentsStorage::Ptr ( this )-> components )
18+ for (const auto & component : components)
1919 {
2020 if (component->GetType ()->IsA (type))
2121 {
@@ -28,17 +28,19 @@ struct EntityEx : Red::Entity
2828
2929 Red::DynArray<Red::Handle<Red::IComponent>> GetComponents ()
3030 {
31- return Raw::Entity::ComponentsStorage ( this )-> components ;
31+ return components;
3232 }
3333
3434 void AddComponent (const Red::Handle<Red::IComponent>& aComponent)
3535 {
36- Raw::Entity::ComponentsStorage (this )->components .PushBack (aComponent);
36+ aComponent->owner = this ;
37+
38+ components.PushBack (aComponent);
3739 }
3840
3941 void SetWorldTransform (const Red::WorldTransform& aTransform)
4042 {
41- Raw::IPlacedComponent::SetTransform (Raw::Entity::TransformComponent::Ref ( this ) , aTransform);
43+ Raw::IPlacedComponent::SetTransform (transformComponent , aTransform);
4244 }
4345
4446 bool ApplyMorphTarget (Red::CName aTarget, Red::CName aRegion, float aValue);
Original file line number Diff line number Diff line change @@ -6,13 +6,11 @@ struct gamedataTDBIDHelperEx : Red::gamedataTDBIDHelper
66{
77 static Red::TweakDBID FromNumber (uint64_t aHash)
88 {
9- return {. value = aHash};
9+ return {aHash};
1010 }
1111};
1212}
1313
1414RTTI_EXPAND_CLASS (Red::gamedataTDBIDHelper, App::gamedataTDBIDHelperEx, {
15- RTTI_ALIAS (" TDBID" );
16-
1715 RTTI_METHOD (FromNumber);
1816});
Original file line number Diff line number Diff line change 6868#include " App/Utils/NodeRef.hpp"
6969#include " App/Utils/Number.hpp"
7070#include " App/Utils/String.hpp"
71- #include " App/Utils/TDBIDHelperEx .hpp"
71+ #include " App/Utils/TweakDBID .hpp"
7272#include " App/World/DynamicEntityEvent.hpp"
7373#include " App/World/DynamicEntitySpec.hpp"
7474#include " App/World/DynamicEntityState.hpp"
Original file line number Diff line number Diff line change @@ -1221,7 +1221,9 @@ Add the following casts:
12211221### TDBID
12221222
12231223``` swift
1224- let hash = 191898568373ul ; // Mizutani Shion Coyote
1224+ // Vehicle.v_sport2_mizutani_shion_nomad_player
1225+ // 0x0000002CAE0BC6B5
1226+ let hash = 191898568373ul ;
12251227let recordID = TDBID.FromNumber (hash);
12261228```
12271229
@@ -1235,4 +1237,4 @@ let recordID = TDBID.FromNumber(hash);
12351237- [ Bits] ( https://github.com/psiberx/cp2077-codeware/blob/main/scripts/Utils/Bits.reds )
12361238- [ Vector2] ( https://github.com/psiberx/cp2077-codeware/blob/main/scripts/Utils/Vector2.reds )
12371239- [ Vector3] ( https://github.com/psiberx/cp2077-codeware/blob/main/scripts/Utils/Vector3.reds )
1238- - [ TDBID ] ( https://github.com/psiberx/cp2077-codeware/blob/main/scripts/Utils/TDBID .reds )
1240+ - [ TweakDBID ] ( https://github.com/psiberx/cp2077-codeware/blob/main/scripts/Utils/TweakDBID .reds )
You can’t perform that action at this time.
0 commit comments