summaryrefslogtreecommitdiff
path: root/src/playerrelations.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-10-29Fixed storing of player relationsHEADmasterThorbjørn Lindeijer1-22/+14
There were two issues here. First, the loading of the relations was triggering a storing of the settings before they were loaded. In effect, all the related settings were reset on every startup. And since storing of the relations wasn't enabled by default, they were always cleared. Second problem was in `PlayerConfSerialiser::readConfigItem`, which was never setting any relation because of an inverted condition introduced in 9a702e64449ba54fab28706c5b9c5ff9f2a41f8a.
2024-10-29Turned the PlayerRelation struct into an enum classThorbjørn Lindeijer1-44/+31
Less code to achieve the same thing (strong type and namespaced values). The permissions related values have been moved to a PlayerPermissions struct, which is also a bit less confusing.
2024-10-29Optimise PlayerRelationsManager::clearThorbjørn Lindeijer1-21/+12
Previous implementation was O(n^2), doing lots of work (saving file and updating UI) for each removed player.
2024-10-29Avoid some needless pointer indirectionThorbjørn Lindeijer1-58/+33
* Don't use `PlayerRelation*` in `mRelations`, but just store the value. * Pass `std::vector<PlayerIgnoreStrategy *>` by reference instead of pointer. * Return player list in `PlayerRelationsManager::getPlayers` by value instead of pointer. Overall these changes simplify the code, making it less prone to errors.
2024-10-26Fixed FPS limit being enabled by defaultThorbjørn Lindeijer1-2/+1
There were some inconsistencies between the values set up in `Client::initConfiguration` and those in `getConfigDefaults`. These duplicates have now been removed. For some of these settings the code getting the values had to be adjusted to use getBoolValue, to actually rely on the provided default instead of one provided as a parameter.
2024-10-08Use Timer for duration of blinking nameThorbjørn Lindeijer1-1/+1
This fixes the duration on 1500 ms, whereas before it was dependent on the framerate, blinking for 200 frames.
2024-10-08Do a single logic update each frameThorbjørn Lindeijer1-1/+1
The logic update now uses Time::deltaTimeMs() where needed to make it framerate-independent. This means there will no longer be multiple logic calls per frame (as was usually the case with logic ticking at 100 fps whereas the game would generally run at 60 fps). At the same time, the game can be more precise at higher framerates and should now run smoother at 144 Hz, for example. Previously the game would sometimes skip logic ticks at that rate. This change affects: * Updating of animations * Being movement speed * More moving of manual time variables to Timer Notoriously, the particle system still does 100 ticks/second.
2024-03-02General code cleanupsThorbjørn Lindeijer1-18/+9
* Don't needlessly store or return raw pointers in BeingInfo * Less copying, more moving * Less else after return * Make AddDEF a template instead of a macro * Removed some unused includes * Use range-based for loops
2024-02-22General code cleanupsThorbjørn Lindeijer1-1/+1
* Use default member initializers * Use range-based loops * Don't use 'else' after 'return' * Removed some unused includes * Construct empty strings with std::string() instead of "" * Clear strings with .clear() instead of assigning "" * Check whether strings are empty with .empty() instead of comparing to "" * Removed redundant initializations
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer1-9/+7
modernize-loop-convert modernize-deprecated-headers
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-17/+17
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-04-02Fixed problems with using the last emotev0.6.1Thorbjørn Lindeijer1-2/+1
The tmwa/BeingHandler was adjusting the effect id rather than the emote id, causing it to not find the last emote (and the rest of the emotes only worked correctly because the effect ids were consecutive in the same order as the emote ids). Furthermore, the EmoteShortcutContainer refused to draw the icon for the last emote due to an off-by-one error in dealing with the 1-adjusted emote ids used by the EmoteShortcut class. Also cleaned up some old remains of a player ignore strategy that used to use the two balloon emotes (this had been their original purpose). Reviewed-by: Erik Schilling
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-09Hopefully fixed the crash related to player relations.Yohann Ferreira1-27/+44
I removed all the misuse of std::map::operator[] I could find, especially there: if (!(*container)[name]) where the [] was creating the entry while checking for its existence. This should avoid the memory corruption problem seen in the Mana-Mantis #400. Patch tested in game by: Ablu. Resolves: Mana Mantis #400 Reviewed-by: Ablu.
2011-10-23Fixed a certain class of Doxygen warningsThorbjørn Lindeijer1-4/+5
All cases of documentation for non-existing parameters are now fixed. Also marked a few getters as 'const', removed some superfluous 'inline' keywords and removed the unused 'forceQuantity' option from ItemContainer. Reviewed-by: Yohann Ferreira
2010-11-07Convert the emote system to use particlesChuck Miller1-29/+0
Reviewed-by: Jared Adams
2010-06-13Merge remote branch '1.0/1.0'Jared Adams1-1/+10
Conflicts: data/graphics/CMakeLists.txt data/graphics/Makefile.am src/client.cpp
2010-06-10Merge BeingManager and FloorItemManager as ActorSpriteManagerJared Adams1-3/+3
No need for two different classes to manage ActorSprites. Reviewed-by: Chuck Miller
2010-06-06Fix memory leak in playerrelationsAndrei Karas1-1/+10
Reviewed-by: Thorbjørn Lindeijer
2010-05-17Remove Monster, Player, and NPC classesJared Adams1-12/+12
Instead of having these three subclasses with minor differences, this commit merges them back into Being. In the future, we can make Beings that are talkable to some, attackable by others, etc. This also puts back support for monster equipment. Also changes remaining references to Being::Type and the constants to refer to ActorSprite::Type. Reviewed-by: Freeyorp
2010-04-04Fix a crash in PlayerRelationsManagerJared Adams1-1/+1
2010-03-26Replace most dynamic_casts with static_castsJared Adams1-4/+3
The remaining instances can't easily or safely be changed as the classes involved don't have type information like Being does. Reviewed-by: Freeyorp
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2010-01-10Change code styleAndrei Karas1-6/+14
2009-08-13Clean up Being and it's derivativesJared Adams1-1/+1
Move stuff only needed for Players into Player (like slots and sprite limits). Move name handling into Being (no need for three copies of this code). Clean up terminology (including Map terminology). Remove hair-related variables.
2009-08-07Gettext fixesKess Vargavind1-5/+6
Trying to use the same kind of capitalization and interpunctuation for various parts of the gui, melding a few split strings, updating POTFILES.in and adding translators' notes.
2009-05-12Some small cleanups and fixed compile with tmwserv supportBjørn Lindeijer1-5/+5
2009-05-11Made player relations persistent by default and removed option from GUIBjørn Lindeijer1-2/+2
Also changed the config key to make sure the new default applies to everybody. It is now 'persistent-player-list' instead of 'persist-player-list'.
2009-04-29Removed underscores from some non-conforming filenamesBjørn Lindeijer1-0/+375
We don't use underscores in the filenames generally, and let's be consistent on that matter.