Skip to content

Conversation

@SirYodaJedi
Copy link

@SirYodaJedi SirYodaJedi commented Dec 9, 2025

This PR attempts to enable the filtername KV on func_door, func_door_rotating, and func_water, which is present in the SDK, but is ifdefed to only be compiled in HL:S+HLDMS. This PR modifies the relevant ifdefs to also apply to Mapbase, without enabling any code unrelated to the block filter.

The filtername KV indicates a filter to determine entities (other than players) that can block the door (could be useful for NPCs). It is actually present in the vanilla FGD entry for func_door, despite not working outside of HL:S. It should be moved to the Door baseclass. A modified FGD entry is as such:

	filtername(filterclass) : "Block Filter Name" : : "Filter to use to determine entities that can block the door."

This is flagged as a draft, because it needs to be tested further (and apparently doesn't compile).


Does this PR close any issues?

  • No.

PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

@Blixibon
Copy link
Member

Just FYI, I think the only reason this doesn't compile is because it has incorrect #ifdef syntax:

#ifdef HL1_DLL || MAPBASE

Instead of using #ifdef, it should use #if defined(), like this:

#ifdef defined(HL1_DLL) || defined(MAPBASE)

@SirYodaJedi
Copy link
Author

Changed to this, as per other examples in SDK.

#if defined(HL1_DLL) || defined(MAPBASE)

Wonder why it still compiled on Linux.

@Blixibon
Copy link
Member

Blixibon commented Dec 13, 2025

Changed to this, as per other examples in SDK.

#if defined(HL1_DLL) || defined(MAPBASE)

I didn't realize I typed #ifdef instead of #if in my corrected version... sorry, I had just woken up 🤦

Wonder why it still compiled on Linux.

The SP SDK codebase makes Windows treat all compile warnings as errors, but it does not do that for Linux. I don't know if that's by design, but Linux/GCC is generally a lot stricter than Windows/VC++, so it tends to have a lot more warnings on average. You could see that the warning appeared on Linux, but did not result in an error:

In file included from /home/runner/work/source-sdk-2013/source-sdk-2013/sp/src/game/server/../../game/shared/baseplayer_shared.cpp:32:
/home/runner/work/source-sdk-2013/source-sdk-2013/sp/src/game/server/doors.h:144:16: warning: extra tokens at end of #ifdef directive
  144 | #ifdef HL1_DLL || MAPBASE
      |                ^~

It's interesting that they ended up having opposite roles this time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants