feat: adapt to GMLIB v1.0.2

This commit is contained in:
KobeBryant114514
2025-05-07 21:22:34 +08:00
Unverified
parent 8aefbf335b
commit 9a31f363f8
5 changed files with 53 additions and 15 deletions
+6 -2
View File
@@ -152,7 +152,8 @@ void Export_Compatibility_API() {
);
RemoteCall::exportAs("GMLIB_API", "getVersion_LRCA", []() -> std::string { return LIB_VERSION.to_string(); });
RemoteCall::exportAs("GMLIB_API", "getVersion_GMLIB", []() -> std::string {
return GMLIB_VERSION_TO_STRING(GMLIB_VERSION_MAJOR) "." GMLIB_VERSION_TO_STRING(GMLIB_VERSION_MINOR
return GMLIB_VERSION_TO_STRING(GMLIB_VERSION_MAJOR) "." GMLIB_VERSION_TO_STRING(
GMLIB_VERSION_MINOR
) "." GMLIB_VERSION_TO_STRING(GMLIB_VERSION_PATCH);
});
RemoteCall::exportAs(
@@ -582,7 +583,7 @@ void Export_Compatibility_API() {
return player->attack(*entity, SharedTypes::Legacy::ActorDamageCause::EntityAttack);
});
RemoteCall::exportAs("GMLIB_API", "playerPullInEntity", [](Player* player, Actor* entity) -> void {
if (auto component = player->getEntityContext().tryGetComponent<RideableComponent>()){
if (auto component = player->getEntityContext().tryGetComponent<RideableComponent>()) {
component->pullInEntity(*player, *entity);
}
});
@@ -951,4 +952,7 @@ void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "getEntityTypeId", [](Actor* entity) -> int {
return (int)entity->getEntityTypeId();
});
RemoteCall::exportAs("GMLIB_API", "getPlayerProtocolVersion", [](Player* player) -> int {
return ((GMPlayer*)player)->getNetworkProtocolVersion();
});
}