Add LookupEntityAttachment & GetEntityAttachment natives (#1653)

Using the virtual `CBaseAnimating::GetAttachment(int, matrix3x4_t &)` was a deliberate choice because virtual offsets are generally easier to maintain than signatures. The `matrix3x4_t` is converted to world position and world angles internally.
Some of the other overloads are also inlined on a few games, making this the best choice.

Since this call can only be used on classes inheriting `CBaseAnimating`, we check if the `DT_BaseAnimating` SendTable exists on the entity, throwing a native error if it doesn't.
This safeguard could be greatly improved with a call to `CBaseEntity::GetBaseAnimating`, but would require more gamedata (maybe something to consider for the future?)
This commit is contained in:
Mikusch
2022-01-03 13:13:54 +00:00
committed by GitHub
parent bf898dd45f
commit afc9310704
8 changed files with 246 additions and 0 deletions
+22
View File
@@ -184,6 +184,21 @@
}
}
/* CBaseAnimating::LookupAttachment */
"#default"
{
"Signatures"
{
"LookupAttachment"
{
"library" "server"
"windows" "\x55\x8B\xEC\x57\x8B\xF9\x83\xBF\xC0\x04\x00\x00\x00\x75\x2A\xA1\x2A\x2A\x2A\x2A\x56\x8B\x30\x8B\x07\xFF\x50\x18\x8B\x0D\x2A\x2A\x2A\x2A\x50\xFF\x56\x04\x5E\x85\xC0\x74\x2A\x8B\xCF\xE8\x2A\x2A\x2A\x2A\x8B\x8F\xC0\x04\x00\x00\x5F\x85\xC9\x74\x2A\x83\x39\x00\x74\x2A\x8B\x55\x08\xE8\x2A\x2A\x2A\x2A"
"linux" "\x55\x89\xE5\x53\x83\xEC\x14\x8B\x5D\x08\x8B\x8B\xD8\x04\x00\x00\x85\xC9\x74\x2A\x8B\x83\xD8\x04\x00\x00\x85\xC0\x74\x2A\x8B\x10\x85\xD2\x74\x2A\x8B\x55\x0C\x89\x04\x24"
"linux64" "\x55\x48\x89\xE5\x53\x48\x89\xFB\x48\x83\xEC\x18\x48\x8B\xBF\x28\x06\x00\x00\x48\x85\xFF\x74\x2A\x48\x83\x3F\x00\x74\x2A\xE8\x2A\x2A\x2A\x2A"
}
}
}
/* SetUserInfo data */
"#default"
{
@@ -354,6 +369,13 @@
"linux64" "280"
"mac64" "280"
}
"GetAttachment"
{
"windows" "222"
"linux" "223"
"linux64" "223"
"mac64" "223"
}
}
"Signatures"
{
+15
View File
@@ -89,6 +89,21 @@
}
}
/* CBaseAnimating::LookupAttachment */
"#default"
{
"Signatures"
{
"LookupAttachment"
{
"library" "server"
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x80\xBE\x31\x03\x00\x00\x00\x75\x2A\x83\xBE\x50\x04\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x50\x04\x00\x00\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75\x08\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x40"
"linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
"mac" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
}
}
}
/* SetUserInfo data */
"#default"
{
+25
View File
@@ -167,6 +167,25 @@
}
}
}
/* CBaseAnimating::LookupAttachment */
"#default"
{
"#supported"
{
"game" "left4dead"
}
"Signatures"
{
"LookupAttachment"
{
"library" "server"
"windows" "\x56\x8B\xF1\x83\xBE\x68\x04\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x68\x04\x00\x00\x85\xC0\x5E\x74\x2A\x83\x38\x00\x75\x2A\x33\xC0\xC2\x04\x00\x8B\x4C\x24\x04"
"linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
"mac" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
}
}
}
/* SetUserInfo data */
"#default"
@@ -306,6 +325,12 @@
"linux" "428"
"mac" "428"
}
"GetAttachment"
{
"windows" "202"
"linux" "203"
"mac" "203"
}
}
}
}
+6
View File
@@ -123,6 +123,12 @@
"linux" "253"
"mac" "253"
}
"GetAttachment"
{
"windows" "205"
"linux" "206"
"mac" "206"
}
}
}
}
@@ -79,6 +79,21 @@
}
}
/* CBaseAnimating::LookupAttachment */
"#default"
{
"Signatures"
{
"LookupAttachment"
{
"library" "server"
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x83\xBE\xD0\x13\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\xD0\x13\x00\x00\x5E\x85\xC0\x74\x2A\x83\x38\x00\x75\x2A\x33\xC0\x5D\xC2\x04\x00\x8B\x4D\x08"
"linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
"mac" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
}
}
}
/* IServer interface pointer */
"#default"
{
@@ -217,6 +232,12 @@
"linux" "275"
"mac" "275"
}
"GetAttachment"
{
"windows" "219"
"linux" "220"
"mac" "220"
}
}
"Keys"
+21
View File
@@ -112,6 +112,12 @@
"linux" "260"
"mac" "260"
}
"GetAttachment"
{
"windows" "212"
"linux" "213"
"mac" "213"
}
}
"Keys"
@@ -135,4 +141,19 @@
}
}
}
/* CBaseAnimating::LookupAttachment */
"#default"
{
"Signatures"
{
"LookupAttachment"
{
"library" "server"
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x80\xBE\x41\x03\x00\x00\x00\x75\x2A\x83\xBE\x6C\x04\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x6C\x04\x00\x00\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75\x08\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x40"
"linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
"mac" "@_ZN14CBaseAnimating16LookupAttachmentEPKc"
}
}
}
}