mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Allow specifying name for dynamic media files
This commit is contained in:
parent
af69d4f7a9
commit
c90ebad46b
5 changed files with 15 additions and 9 deletions
|
@ -3568,10 +3568,11 @@ void Server::deleteParticleSpawner(const std::string &playername, u32 id)
|
|||
SendDeleteParticleSpawner(peer_id, id);
|
||||
}
|
||||
|
||||
bool Server::dynamicAddMedia(std::string filepath,
|
||||
bool Server::dynamicAddMedia(std::string filename, std::string filepath,
|
||||
const u32 token, const std::string &to_player, bool ephemeral)
|
||||
{
|
||||
std::string filename = fs::GetFilenameFromPath(filepath.c_str());
|
||||
if (filename.empty())
|
||||
filename = fs::GetFilenameFromPath(filepath.c_str());
|
||||
auto it = m_media.find(filename);
|
||||
if (it != m_media.end()) {
|
||||
// Allow the same path to be "added" again in certain conditions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue