Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a new convenience function to obtain the worldspawn
Locating the worldspawn node and converting it into an Entity pointer is a very common operation, but so far has had to be done manually each time. Now there is a convenience function map::current::getWorldspawn() which does this automatically.
- Loading branch information
Matthew Mott
committed
Mar 25, 2020
1 parent
70dc070
commit 41cf59f
Showing
6 changed files
with
34 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,3 +114,4 @@ inline IMap& GlobalMapModule() { | |
); | ||
return _mapModule; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include "imap.h" | ||
#include "ientity.h" | ||
|
||
namespace map | ||
{ | ||
|
||
namespace current | ||
{ | ||
|
||
/// Convenience method to return the worldspawn entity pointer | ||
inline Entity* getWorldspawn() | ||
{ | ||
return Node_getEntity(GlobalMapModule().getWorldspawn()); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters