From 878dcdc0a46315227ee1d558ead5dbc538f34e55 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 6 Apr 2014 12:56:51 +0300 Subject: [PATCH 1/2] Fix loading of lumps from directory on OS X Use POSIX-compliant opendir() / readdir() functions instead fts_open() / fts_read() Unlike Linux version, on OS X fts_read() inserts extra slash character between source directory and traversed entry paths --- src/resourcefiles/file_directory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resourcefiles/file_directory.cpp b/src/resourcefiles/file_directory.cpp index e9076ae9b..024ef0633 100644 --- a/src/resourcefiles/file_directory.cpp +++ b/src/resourcefiles/file_directory.cpp @@ -198,7 +198,7 @@ int FDirectory::AddDirectory(const char *dirpath) return count; } -#elif defined(__sun) +#elif defined(__sun) || defined(__APPLE__) int FDirectory::AddDirectory(const char *dirpath) { From ca93e04de37cb9f105c7c8d0106868013b403395 Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Mon, 7 Apr 2014 23:23:55 +1200 Subject: [PATCH 2/2] Added GetActorPowerupTics ACS function --- src/p_acs.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 4909a79d6..4cb34defa 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4260,6 +4260,7 @@ enum EACSFunctions ACSF_CheckFlag, ACSF_SetLineActivation, ACSF_GetLineActivation, + ACSF_GetActorPowerupTics, // ZDaemon ACSF_GetTeamScore = 19620, // (int team) @@ -5325,6 +5326,27 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) } break; + case ACSF_GetActorPowerupTics: + if (argCount >= 2) + { + const PClass *powerupclass = PClass::FindClass(FBehavior::StaticLookupString(args[1])); + if (powerupclass == NULL || !RUNTIME_CLASS(APowerup)->IsAncestorOf(powerupclass)) + { + Printf("'%s' is not a type of Powerup.\n", FBehavior::StaticLookupString(args[1])); + return 0; + } + + AActor *actor = SingleActorFromTID(args[0], activator); + if (actor != NULL) + { + APowerup* powerup = (APowerup*)actor->FindInventory(powerupclass); + if (powerup != NULL) + return powerup->EffectTics; + } + return 0; + } + break; + default: break; }