It's not necessary to create a new `CTextureHandle` object after unloading the handle and it's also not necessary to check if the texture handle is valid when unloading it.
Store and update the last race tick directly in `CGameClient` instead of in `CGhost`, as the value is also used in the gameclient.
Move current race time calculation from `CClient` to `CGameClient`, as this function is not used in the engine and this allows removing unnecessary virtual functions.
Closes#1720.
Show popup to select the envelope curve type from a list when right clicking the curve type button, as selecting the curve type by pressing the button multiple times is inconvenient.
Switch to previous curve type on shift+left clicking the curve type button.
The `CLayers::InitBackground` function implemented a subset of the `CLayers::Init` function, only loading the game layers and not the other entities layers, so a Boolean parameter can be used to reduce the duplicate code.
The additional code to evaluate envelopes during demo playback is obsolete, as client ticks are already properly synchronized with the demo playback.
From teeworlds/teeworlds#2750 and teeworlds/teeworlds#2768.
Use a condition variable instead of busy waiting until HTTP requests are done.
Also set the state `EHttpState::RUNNING` which was previously unused.
Closes#7811.
When maps are loaded from folders on the server, the same folders were used for demos but recording would usually fail due to the folders not existing in the demos folder.
Furthermore, the map name being written in the demo header also included the folder names, which causes the client to not find the map unless it also exists at that location.
Closes#9033.
Store the current map filename (without path) separately when loading a new map instead of determining it again each time that the `CServer::GetMapName` function is called.
Use the `fs_filename` function for this.
Avoid the usage of the `sv_map` config variable for this, which may have caused the returned map filename to be out-of-sync with the real map on the server due to the map specified by the config variable not being reloaded immediately.
- Add `CTeeRenderInfo::ApplyColors` function to reduce duplicate code.
- Use `CTeeRenderInfo::Apply` function in more cases.
- Use `CSkins::Find` function instead of implementing default skin handling manually with the `FindOrNullptr` function for chat settings preview.
- Remove redundant initialization of `CTeeRenderInfo::m_CustomColoredSkin` member.
- Replace empty client skin with `default` instead of checking for empty skin names later.
- Remove unnecessary check for empty skin name for ghost rendering. The `CSkins::Find` function will return the default skin for an empty skin name, which is more correct than invalidating the ghost skin render info.
Previously, skins not found in the `skins` folder were downloaded from the configured URL and saved to the `downloadedskins` folder, but the saved files were never used, leading to wasted downloads and write operations.
Now, if a skin to be downloaded already exists in the `downloadedskins` folder, the modified time of the skin file is determined and included in the HTTP GET request as `If-Modified-Since` header. If the file was not modified on the server since that time, the server will answer with status 304 Not Modified and an empty response body, in which case the existing skin file is loaded. If the skin file was modified, then it will be downloaded like usual. The download will also be retried without including the `If-Modified-Since` header, if the local file is more recent but it failed to be loaded. If a skin could not be downloaded when it should but a file already exists in the `downloadedskins` folder then that file will be loaded instead.
Instead of checking whether the number of skins is different to determine whether to reload the list of skins in the settings menus, the last time that the list of skins was refreshed is now saved and compared, which is more robust. The additional check to refresh the skin list while skins are being downloaded is unnecessary, as any updates to the skin list are now covered by checking the last refresh time.
If the sql statement does not contain placeholders
``NumParameters`` can be empty.
In that case accessing the first element will cause an asan error:
```
runtime error: reference binding to null pointer of type 'st_mysql_bind'
```
Add constant to replace the magic number `24` used for the size of skin names. Skin names in the server info/browser were sized `24 + 1` but the additional byte was unnecessary.
When the datafile is closed, only the `CDataFileReader::Open` and `CDataFileReader::Close` functions may be called. All other functions will now assert instead of returning some default-values if no file is open. The `CDataFileReader::Open` function will now assert if the file is already open instead of implicitly closing the previous one.
The whole idea behind custom sounds was to use them as replacement for
built-in sounds (depending on the gameplay). We have to use the same channels
instead of the MAP (aka 'ambient') channel to have the same volume for both
sets of messages.
Otherwise we have situation of players reporting 'no sound' because they have
`snd_ambient_volume 0` in the configs.
NETMSGTYPE_SV_MAPSOUNDGLOBAL is NETMSGTYPE_SV_SOUNDGLOBAL which uses map
assets as the sounds container. Use the same CSounds::CHN_GLOBAL to make
the sound messages equivalent.
NETEVENTTYPE_MAPSOUNDWORLD is NETEVENTTYPE_SOUNDWORLD which uses map assets
as the sounds container. Use the same CSounds::CHN_WORLD to make the sound
events equivalent.
It is compared to 0 in gamecontext.cpp but it is never explicitly set to 0.
```C++
if(pPlayer->GetTeam() == pMsg->m_Team || (g_Config.m_SvSpamprotection && pPlayer->m_LastSetTeam && pPlayer->m_LastSetTeam + Server()->TickSpeed() * g_Config.m_SvTeamChangeDelay > Server()->Tick()))
return;
```
Use the new `avcodec_get_supported_config` function instead of the deprecated `sample_fmts` and `supported_samplerates` members with libavcodec 61.13.100 and newer.
See 76eb3e5ff3/doc/APIchanges (L53-L56)Closes#9085.
There are two interfaces for score worker data:
There is ``ISqlResult`` and every class inheriting from it should have
the suffix ``Result``
Then there is ``ISqlData`` and every class inheriting from it should
have the suffix ``Data`` if it is data that should be written in an
INSERT statement. Or ``Request`` if it is used to perform a read
operation and will be used in a SELECT statament.
The convention was mostly established alreay. In this commit the last
three classes that broke this convention got fixed.
Specifically:
* Ignore freeze, deep freeze, deep unfreeze, live freeze, and live unfreeze tiles
* Ignore also the switched variants of those tiles
* Allow movement when deep and live frozen
* Ignore death tiles
* Ignore red tele, blue tele, red checkpoint tele, and blue checkpoint tele tiles
* Unlimited jumps
* Disable /rescue
Switches, doors, draggers, etc. are not disabled for invincible players in this patch
This commit adds the rcon command "invincible" which toggles the new m_Invincible variable on CCharacterCore. The feature is supposed to be an alterantive to super that is safe for /practice mode. The state of m_Invincible is synchronized to the client via the DDNetCharacter net object. Future commits will change checks for m_Super to check for m_Invincible as well in places where this is safe such as e.g. preventing freezing of the player. The ability to interact with players that are in other teams will remain exclusive to super.
Specifically, SetSuper(false) followed by SetSuper(false) should not change teams. The following commit relies on this, but it is generally a good idea to remove this footgun.