summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-02-04Removing password from memoryStefan Dombrowski1-1/+2
If the player switches login, then the password field in the login window should be empty. This was not the case after registering or password change. Reviewed-by: Ablu, Bertram
2012-02-03Clear tile flags from the gid before further processingThorbjørn Lindeijer5-11/+23
Better to show non-rotated/flipped tiles than no tile at all. This also fixes interpretation of collision tiles that happen to be flipped. Also interpret the gid as an unsigned number, since that's how they are written in the TMX file since the introduction of these flags. Reviewed-by: Yohann Ferreira
2012-02-03Fixed the go and attack mouse clickYohann Ferreira2-24/+51
I first removed the keep attacking and pickup targetting unset statements in the setdestination() function since it was messing with all the rest of the logic, and put those targetting logic where they belonged more. I also changed the gotoTarget function to properly call the setTarget function which permitted to properly unset the previous target in that case. I also finished the logic built around the mGoingToTarget member (until then actually unused) to make it all work again. At last, I also removed a now false comment in the startWalking() function. Reviewed-by: Erik Schilling
2012-02-03Fixed the player character's direction update when clicking on a monster.Yohann Ferreira1-0/+1
The direction is updated in those case only when the engine knows it's the mouse requesting the destination. Reviewed-by: Erik Schilling
2012-02-03Simplified and made generic the way the pickup is handled.Yohann Ferreira11-32/+68
I also made the range be taken from the server type as for the pickup and npc talk ranges. Last but no least, I fixed the parameters sent with PGMSG_PICKUP to send the (item) position where to pickup at as described in the manaserv protocol. The pickup is still not 100% functional due certainly to two problems: 1. The client item coordinates might not be the exact same as in the server. 2. The client seems to try to pick up the item a bit too soon, probably for the reason given in 1. I'll investigate this in another patch. Reviewed-by: Thorbjørn Lindeijer, Erik Schilling.
2012-02-03Changed the setup button at login stage to use the icon.Yohann Ferreira3-5/+9
I also made the button not readjust its size when deleted to avoid a crash. Reviewed-by: Erik Schilling
2012-02-02Fixed player's character direction.Yohann Ferreira2-4/+4
Made the player's character look at where it is going even when using the keyboard, by setting its direction after getting the actual destination, and not before. I also used the lookAt() function to avoid yet another custom way of setting the direction. Reviewed-by: Erik Schilling
2012-02-02Fixed diagonal walking to be much more smooth.Yohann Ferreira1-72/+65
The character used to stick to both corners of an obstacle it encountered when walking diagonally. Now it simply go back to the straight moving mode when encountering an obstacle in one of the two direction used. This also simplifies the function logic. The character direction bug left is still there, and will be dealt in a separate patch with. Reviewed-by: Erik Schilling
2012-02-02Remove duplicate direction computation by a call to lookAt()Yohann Ferreira1-19/+1
It simply does the same thing, in better. Reviewed-by: Erik Schilling
2012-02-02Fix to the hair colors and styles handling.Yohann Ferreira15-126/+269
- I made the charCreatedialog handle a possible max permitted color Id and a minimum hair style id for tA. - Added a foundation to later load the styles and colors from the same file, to handle the Mana-issue #224 for manaserv. - Support for non-contiguous hair color and style ids has also been added. - I also replaced the < and > arrow signs with images. Reviewed-by: Ben Longbons, Thorbjørn Lindeijer
2012-02-02Fixed the use of custom particle effects for attacks.Yohann Ferreira2-7/+7
The tA beingmanager was wrongly using the attack type in the Being::handleAttack() function, which is in fact used to set the attack id. Thus, breaking the attack id given and all its attack parameters. I noticed that while updating the client data for TMW. Reviewed-by: Thorbjørn Lindeijer
2012-01-31Fixed saving the selected server at server connection level.Yohann Ferreira2-3/+5
I also change the serverInfo to use a deque to permit the use of the push_front function. Spotted and reviewed-by: Erik Schilling
2012-01-31Added missing copyright notices.Yohann Ferreira29-1/+52
Reviewed-by: Erik Schilling
2012-01-30Add default offsets in imageset tag for all animations.Andrei Karas3-3/+24
Reviewed-by: Bjorn.
2012-01-30Keep a single blank line between NPC textsThorbjørn Lindeijer1-0/+1
Makes it easier to see what was added during a conversation. Reviewed-by: Yohann Ferreira
2012-01-29Removed Sprite::getCurrentFrame and Sprite::getFrameCountThorbjørn Lindeijer6-96/+1
They are apparently no longer being used. Reviewed-by: Erik Schilling
2012-01-29Removed inheritance from std::vector by CompoundSpriteThorbjørn Lindeijer2-45/+47
In my opinion, the code is clearer when using aggregation. For performance it makes no difference. This also fixes a memory leak in CompountSprite::clear, which forgot to delete any existing sprites. Reviewed-by: Erik Schilling
2012-01-28Moved mTrading into the TradeHandlerThorbjørn Lindeijer8-43/+14
Really only the trade handler is concerned about whether the player is currently in a trade or not. Reviewed-by: Erik Schilling
2012-01-28Make command line choose character only work onceThorbjørn Lindeijer1-0/+4
Previously it was interfering with the 'switch character' functionality. Reviewed-by: Erik Schilling
2012-01-27Fixed loading of the server listThorbjørn Lindeijer1-1/+0
A wrong (and duplicate) default entry for the 'onlineServerList' option for branding files was causing it to malfunction. The problem only showed up after the initialization of defaults was changed in commit b856e8b47ab2dfd393e3c2720c5647eb66393931. Before that, branding config file defaults were not being set when no branding file was used. Reviewed-by: Yohann Ferreira
2012-01-27Random hacking cleanups in the LocalPlayer classYohann Ferreira3-49/+35
- Renamed mLastTarget to mLastTargetTime, and mLastAction to mLastActionTime to clarify their use. - NULL -> 0. - Removed the unused mLocalWalkTime member. + Change requested by bjorn. Reviewed-by: Thorjørn Lindeijer
2012-01-26Remove "> Next" from NPC dialogsAndrei Karas1-2/+0
Reviewed-by: Thorbjørn Lindeijer
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer479-479/+479
2012-01-26Removed 'inline' keyword where it's not of any valueThorbjørn Lindeijer11-51/+51
Members that are implemented inline are already inline, there is no need to mark them as such. Made two inline members of OpenGLGraphics private since because they are marked as inline, they can't be used from other classes. Reviewed-by: Erik Schilling
2012-01-26Remember the window size after resizingThorbjørn Lindeijer1-0/+5
Makes sure that the client starts up again in the same size. Reviewed-by: Erik Schilling
2012-01-24Fixed the crash in setupSpriteDisplayThorbjørn Lindeijer7-20/+20
This happened when an NPC, monster or item couldn't be found and it had to fall back on Being::Unknown. This instance was bugged since it had a 0 pointer in its sprites list, because when the Being::Unknown was created, the SpriteDef::Empty was not initialized yet (since both were global static variables, the initialization order was not well defined). Fixed it by removing SpriteDef::Empty and instead creating it in the BeingInfo constructor. I've also changed the SpriteReference instances to be inline values rather than instances on the heap, since they're quite small. That also fixed a leak since those instances were never getting deleted. Reviewed-by: Yohann Ferreira
2012-01-24Stream music files directly from the archivesThorbjørn Lindeijer6-115/+59
Use Mix_LoadMUS_RW to stream music files directly from PhysFS. I kept around ResourceManager:copyFile for now, since it may have other uses. Also cleaned up some initialization of configuration defaults. Reviewed-by: Yohann Ferreira
2012-01-24Removed unused function Image::SDLmergeThorbjørn Lindeijer2-87/+0
Reviewed-by: Yohann Ferreira
2012-01-24Use SDL_RWops directly on top of PhysFSThorbjørn Lindeijer11-52/+314
This avoids the creation of a temporary buffer containing a complete file for the sole purpose of wrapping it up in an SDL_RWops. The necessary wrapper is by Ryan C. Gordon and is included in the PhysFS repository under 'extras'. Reviewed-by: Yohann Ferreira
2012-01-22Prevented looking at item when picking up while movingErik Schilling5-28/+24
+ Fixes from Bjorns review. Reviewed-by: Bjorn.
2012-01-22Allow resizing of the game in windowed modeThorbjørn Lindeijer13-75/+178
Window positions are semi-smartly corrected as a result of the resize. Not supported when using OpenGL on Windows for now. Reviewed-by: Yohann Ferreira
2012-01-22Synced manaserv_protocol file with serverErik Schilling1-12/+19
Reviewed-by: Bertram.
2012-01-21Clientside fix of switching from /announce to @announceErik Schilling3-7/+6
- Added support for senders of announcement Reviewed-by: Bjorn.
2012-01-20Made the update window bigger and resizableThorbjørn Lindeijer1-6/+7
Also made it remember its size and position. Reviewed-by: Erik Schilling
2012-01-20Made the ignore record parameter usefulErik Schilling1-1/+1
Reviewed-by: Bjorn.
2012-01-20Fixed a bug with hurt sounds volume and simplified codeThorbjørn Lindeijer3-24/+17
The hurt sound volume was being played based on the distance in tiles, even though Sound::playSfx was expecting pixels. This would cause hurt sounds of other players to play too loud. There were also several conversions between pixel and tile coordinates that could be simplified. Reviewed-by: Yohann Ferreira
2012-01-19Fixed handling of problems with loading the initial mapThorbjørn Lindeijer1-7/+8
This can always happen, either due to mismatching local data or a server-side error. The client displays a pop-up in this case, but it's not possible to read that when it crashes as well. Reviewed-by: Yohann Ferreira
2012-01-19Fixed the click area for NPCs and other playersThorbjørn Lindeijer1-8/+17
By taking into account that the sprite is drawn half a tile lower than the position of the being (that is messy on its own, but hard to fix while supporting both pixel and tile based movement). It also makes sure that the click area is at least 32x32 pixels, no matter how small the being. This fixes the lack of a clickable area for NPCs without a sprite (like some chests or signs) and makes small monsters like maggots easier to hit. Reviewed-by: Yohann Ferreira
2012-01-18ColorDB -> HairDB.Yohann Ferreira11-34/+36
This will ease the reading of the next patch about hair handling at character creation time in tAthena. As requested by bjorn. Reviewed-by: bjorn
2012-01-18Found a better way to fix the movement glitches on both servers.Yohann Ferreira7-70/+26
The patch also takes care of not spamming the different servers, when the servers are setting the being speed correctly. The most problems were coming from the keyboard movement functions handling 1 tile paths. To void the issues seen in #405, #439, and #440, I simply prevented to set a new path before reaching the destination of the former one, when using the keyboard. The mouse path system remains unchanged. I also made some functions private (or here protected) to show they shouldn't be called by something else than the localplayer object. And I removed the nextTile() function, since it was obsolete, unused, and replaced by the nextTile(direction) function. That patch was tested on both servers with mouse/keyboard mixed use. Resolves: Mana-Mantis #405, #439, #440. Reviewed-by: bjorn
2012-01-17Fix update error if file line is empty, like in aethyra updatesAndrei Karas1-1/+2
Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Yohann Ferreira
2012-01-16Fixed adminhandler being not initializedErik Schilling4-1/+19
This fixes a segfault when trying to do /announce on manaserv servers. Reviewed-by: Bertram, bjorn.
2012-01-16Renamed some file names for consistency with the class namesThorbjørn Lindeijer44-71/+69
This was already done by ManaPlus. It's a good idea anyway and it makes comparing the code a little easier. Reviewed-by: Yohann Ferreira
2012-01-16Increased the default font sizeThorbjørn Lindeijer1-1/+1
Just to make everything a bit more readable on modern screen resolutions. Reviewed-by: Yohann Ferreira
2012-01-16Restore GL_PACK_ALIGNMENT after creating screenshots in OpenGL modeAndrei Karas1-0/+4
Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Yohann Ferreira
2012-01-15Remove dead beings from the minimapStefan Dombrowski1-0/+4
Reviewed-by: Bertram
2012-01-15Show item quantity in the shop listThorbjørn Lindeijer1-23/+40
Rather useful when selling items to quickly see what you have in abundance, rather than only seeing the quantity of the selected item. Reviewed-by: Yohann Ferreira
2012-01-15Don't leak the XMLContext that is created while loading an XML documentThorbjørn Lindeijer1-4/+4
The XMLContext is only relevant while an XML file is being parsed. So rather than allocating it on the heap and forgetting to delete it again, it's now allocated on the stack and thrown away automatically. Reviewed-by: Yohann Ferreira
2012-01-15Removed a strange if check on an uninitialized variableThorbjørn Lindeijer1-3/+2
The 'inflated' pointer wasn't initialized, but included in the if check for some reason (caught by valgrind). This would have caused support for .gz compressed maps to break sometimes, but since we don't use such maps anymore, maybe support for it should actually be dropped. Reviewed-by: Yohann Ferreira
2012-01-15Center the CustomServerDialog on its parent windowThorbjørn Lindeijer6-7/+8
Also shortened the title of the Custom Server dialog to "Custom Server" since it is also used for editing an existing custom server and not just for adding a new one. And used Window::center() in a bunch of places just to reduce code size. Reviewed-by: Yohann Ferreira