From d268447e18c6e3edd80658f8f8d4317740c33af9 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Tue, 10 Feb 2009 20:09:33 -0700 Subject: Fixed header files, as well as removed the unused buddy list class (not useful since buddy lists are tracked through the player relation interface instead) Signed-off-by: Ira Rice --- src/net/beinghandler.cpp | 5 +++-- src/net/beinghandler.h | 5 +++-- src/net/buysellhandler.cpp | 5 +++-- src/net/buysellhandler.h | 5 +++-- src/net/charserverhandler.cpp | 5 +++-- src/net/charserverhandler.h | 5 +++-- src/net/chathandler.cpp | 5 +++-- src/net/chathandler.h | 5 +++-- src/net/equipmenthandler.cpp | 5 +++-- src/net/equipmenthandler.h | 5 +++-- src/net/inventoryhandler.cpp | 5 +++-- src/net/inventoryhandler.h | 5 +++-- src/net/itemhandler.cpp | 5 +++-- src/net/itemhandler.h | 5 +++-- src/net/loginhandler.cpp | 5 +++-- src/net/loginhandler.h | 5 +++-- src/net/maploginhandler.cpp | 5 +++-- src/net/maploginhandler.h | 5 +++-- src/net/messagehandler.cpp | 5 +++-- src/net/messagehandler.h | 5 +++-- src/net/messagein.cpp | 5 +++-- src/net/messagein.h | 5 +++-- src/net/messageout.cpp | 5 +++-- src/net/messageout.h | 5 +++-- src/net/network.cpp | 5 +++-- src/net/network.h | 5 +++-- src/net/npchandler.cpp | 5 +++-- src/net/npchandler.h | 5 +++-- src/net/partyhandler.cpp | 10 +++++----- src/net/partyhandler.h | 10 +++++----- src/net/playerhandler.cpp | 5 +++-- src/net/playerhandler.h | 5 +++-- src/net/protocol.cpp | 5 +++-- src/net/protocol.h | 5 +++-- src/net/skillhandler.cpp | 5 +++-- src/net/skillhandler.h | 5 +++-- src/net/tradehandler.cpp | 5 +++-- src/net/tradehandler.h | 5 +++-- 38 files changed, 118 insertions(+), 82 deletions(-) (limited to 'src/net') diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 2f5f0fee..15a659b3 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h index 54b82075..5fbb57ce 100644 --- a/src/net/beinghandler.h +++ b/src/net/beinghandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index 67c79ec4..245b8a50 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h index 0ede7b48..2b4aaf4f 100644 --- a/src/net/buysellhandler.h +++ b/src/net/buysellhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 932cf705..5bf45bb4 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h index 37b378f2..2a5331b5 100644 --- a/src/net/charserverhandler.h +++ b/src/net/charserverhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index 25877907..14566b39 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/chathandler.h b/src/net/chathandler.h index ff649205..9a47c633 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp index 9a3c396a..fe158198 100644 --- a/src/net/equipmenthandler.cpp +++ b/src/net/equipmenthandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/equipmenthandler.h b/src/net/equipmenthandler.h index c66d7932..08de3b36 100644 --- a/src/net/equipmenthandler.h +++ b/src/net/equipmenthandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp index 46f03e28..ac5f94d3 100644 --- a/src/net/inventoryhandler.cpp +++ b/src/net/inventoryhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index 336b2e98..f87e1214 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/itemhandler.cpp b/src/net/itemhandler.cpp index 8c4af4e4..e38be454 100644 --- a/src/net/itemhandler.cpp +++ b/src/net/itemhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/itemhandler.h b/src/net/itemhandler.h index 0cb3b42a..0f292d46 100644 --- a/src/net/itemhandler.h +++ b/src/net/itemhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 41314d16..34da5c6d 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index df86b634..6b938627 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/maploginhandler.cpp b/src/net/maploginhandler.cpp index b5192bd7..bcd3dd62 100644 --- a/src/net/maploginhandler.cpp +++ b/src/net/maploginhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/maploginhandler.h b/src/net/maploginhandler.h index c7fee70c..fb083b51 100644 --- a/src/net/maploginhandler.h +++ b/src/net/maploginhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/messagehandler.cpp b/src/net/messagehandler.cpp index f1561a31..f45000be 100644 --- a/src/net/messagehandler.cpp +++ b/src/net/messagehandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h index 45cdf8cd..7ff5194b 100644 --- a/src/net/messagehandler.h +++ b/src/net/messagehandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index a288d936..f1ff4013 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/messagein.h b/src/net/messagein.h index 0ff6e78a..94f2bee7 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index bf4957be..ab17f537 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/messageout.h b/src/net/messageout.h index b3a4ef68..93f1c2e8 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/network.cpp b/src/net/network.cpp index 059da779..02d8bf4f 100644 --- a/src/net/network.cpp +++ b/src/net/network.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/network.h b/src/net/network.h index 02fe7538..e264f8a5 100644 --- a/src/net/network.h +++ b/src/net/network.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp index ea03537f..8425a215 100644 --- a/src/net/npchandler.cpp +++ b/src/net/npchandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/npchandler.h b/src/net/npchandler.h index 7ac962eb..35db2956 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp index 03aca66d..3378a5d0 100644 --- a/src/net/partyhandler.cpp +++ b/src/net/partyhandler.cpp @@ -1,15 +1,15 @@ /* - * The Mana World - * Copyright 2004 The Mana World Development Team + * Aethyra + * Copyright (C) 2008 Lloyd Bryant * - * This file is part of The Mana World. + * This file is part of Aethyra. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index 048da9b1..158e89e6 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -1,15 +1,15 @@ /* - * The Mana World - * Copyright 2004 The Mana World Development Team + * Aethyra + * Copyright (C) 2008 Lloyd Bryant * - * This file is part of The Mana World. + * This file is part of Aethyra. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 46ded32e..21c37ea3 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index 1a7c8da3..0500ae44 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp index 69d69901..563c1cc4 100644 --- a/src/net/protocol.cpp +++ b/src/net/protocol.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/protocol.h b/src/net/protocol.h index e9053451..081f8873 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/skillhandler.cpp b/src/net/skillhandler.cpp index e2185524..8ef37101 100644 --- a/src/net/skillhandler.cpp +++ b/src/net/skillhandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h index 2b55605d..689e42dc 100644 --- a/src/net/skillhandler.h +++ b/src/net/skillhandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index c5465835..98f26cbd 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h index d479e43f..8f108248 100644 --- a/src/net/tradehandler.h +++ b/src/net/tradehandler.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- cgit v1.2.3-70-g09d2 From d99b00a149e7828adb3c4651069483e51b0b458b Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 11 Feb 2009 00:01:36 +0100 Subject: Removed many pointless comparisons with NULL Sometimes it's nice for clarity, but most of the time this is just clutter. C++ != Java. :) --- src/being.cpp | 8 ++++---- src/game.cpp | 4 ++-- src/gui/focushandler.cpp | 2 +- src/gui/playerbox.cpp | 2 +- src/gui/popupmenu.cpp | 34 ++++++++++------------------------ src/gui/radiobutton.cpp | 2 +- src/gui/scrollarea.cpp | 2 +- src/gui/table.cpp | 4 ++-- src/gui/truetypefont.cpp | 2 +- src/gui/updatewindow.cpp | 4 ++-- src/gui/widgets/tabbedarea.cpp | 2 +- src/net/partyhandler.cpp | 2 +- src/resources/resourcemanager.cpp | 2 +- src/simpleanimation.cpp | 2 +- src/sound.cpp | 8 ++++---- 15 files changed, 33 insertions(+), 47 deletions(-) (limited to 'src/net') diff --git a/src/being.cpp b/src/being.cpp index 1acbdb50..7a7f3df7 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -344,8 +344,8 @@ void Being::setDirection(Uint8 direction) for (int i = 0; i < VECTOREND_SPRITE; i++) { - if (mSprites[i] != NULL) - mSprites[i]->setDirection(dir); + if (mSprites[i]) + mSprites[i]->setDirection(dir); } } @@ -446,7 +446,7 @@ void Being::logic() for (int i = 0; i < VECTOREND_SPRITE; i++) { - if (mSprites[i] != NULL) + if (mSprites[i]) mSprites[i]->update(tick_time * 10); } @@ -468,7 +468,7 @@ void Being::draw(Graphics *graphics, int offsetX, int offsetY) const for (int i = 0; i < VECTOREND_SPRITE; i++) { - if (mSprites[i] != NULL) + if (mSprites[i]) { mSprites[i]->draw(graphics, px, py); } diff --git a/src/game.cpp b/src/game.cpp index 99888c73..9552c2ef 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -516,8 +516,8 @@ void Game::handleInput() { // Input chat window if (!(chatWindow->isInputFocused() || - deathNotice != NULL || - weightNotice != NULL)) + deathNotice || + weightNotice)) { // Quit by pressing Enter if the exit confirm is there if (exitConfirm && diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp index cb52ae9f..c642127d 100644 --- a/src/gui/focushandler.cpp +++ b/src/gui/focushandler.cpp @@ -27,7 +27,7 @@ void FocusHandler::requestModalFocus(gcn::Widget *widget) /* If there is another widget with modal focus, remove its modal focus * and put it on the modal widget stack. */ - if (mModalFocusedWidget != NULL && mModalFocusedWidget != widget) + if (mModalFocusedWidget && mModalFocusedWidget != widget) { mModalStack.push_front(mModalFocusedWidget); mModalFocusedWidget = NULL; diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp index e05288cc..e7ee3afe 100644 --- a/src/gui/playerbox.cpp +++ b/src/gui/playerbox.cpp @@ -88,7 +88,7 @@ void PlayerBox::draw(gcn::Graphics *graphics) y = getHeight() / 2 + bs; for (int i = 0; i < Being::VECTOREND_SPRITE; i++) { - if (mPlayer->getSprite(i) != NULL) + if (mPlayer->getSprite(i)) { mPlayer->getSprite(i)->draw(static_cast(graphics), x, y); } diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index d10faa0d..7f82d1b5 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -145,55 +145,42 @@ void PopupMenu::showPopup(int x, int y, FloorItem *floorItem) void PopupMenu::handleLink(const std::string& link) { // Talk To action - if (link == "talk" && - mBeing != NULL && - mBeing->getType() == Being::NPC && + if (link == "talk" && mBeing && mBeing->getType() == Being::NPC && current_npc == 0) { dynamic_cast(mBeing)->talk(); } // Trade action - else if (link == "trade" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "trade" && mBeing && mBeing->getType() == Being::PLAYER) { player_node->trade(mBeing); tradePartnerName = mBeing->getName(); } // Attack action - else if (link == "attack" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "attack" && mBeing && mBeing->getType() == Being::PLAYER) { player_node->attack(mBeing, true); } - else if (link == "unignore" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "unignore" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::NEUTRAL); } - else if (link == "ignore" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "ignore" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::IGNORED); } - else if (link == "disregard" && - mBeing != NULL && + else if (link == "disregard" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::DISREGARDED); } - else if (link == "friend" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "friend" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::FRIEND); } @@ -206,7 +193,7 @@ void PopupMenu::handleLink(const std::string& link) /* // Add Buddy action - else if ((link == "buddy") && mBeing != NULL && mBeing->isPlayer()) + else if ((link == "buddy") && mBeing && mBeing->isPlayer()) { if (!buddyWindow->isVisible()) buddyWindow->setVisible(true); @@ -215,7 +202,7 @@ void PopupMenu::handleLink(const std::string& link) }*/ // Pick Up Floor Item action - else if ((link == "pickup") && mFloorItem != NULL) + else if ((link == "pickup") && mFloorItem) { player_node->pickUp(mFloorItem); } @@ -254,8 +241,7 @@ void PopupMenu::handleLink(const std::string& link) { new ItemAmountWindow(AMOUNT_ITEM_DROP, inventoryWindow, mItem); } - else if (link == "party-invite" && - mBeing != NULL && + else if (link == "party-invite" && mBeing && mBeing->getType() == Being::PLAYER) { MessageOut outMsg(player_node->getNetwork()); diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp index 2e48f78a..a8ab61c4 100644 --- a/src/gui/radiobutton.cpp +++ b/src/gui/radiobutton.cpp @@ -93,7 +93,7 @@ void RadioButton::drawBox(gcn::Graphics* graphics) else box = radioDisabled; - if (box != NULL) + if (box) static_cast(graphics)->drawImage(box, 2, 2); } diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index 4c225e81..d655ad52 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -154,7 +154,7 @@ void ScrollArea::logic() // When no scrollbar in a certain direction, adapt content size to match // the content dimension exactly. - if (content != NULL) + if (content) { if (getHorizontalScrollPolicy() == gcn::ScrollArea::SHOW_NEVER) { diff --git a/src/gui/table.cpp b/src/gui/table.cpp index 425c5b6f..b79d43cf 100644 --- a/src/gui/table.cpp +++ b/src/gui/table.cpp @@ -186,7 +186,7 @@ int GuiTable::getColumnWidth(int i) void GuiTable::setSelectedRow(int selected) { - if (mModel == NULL) + if (!mModel) { mSelectedRow = -1; } @@ -214,7 +214,7 @@ void GuiTable::setSelectedRow(int selected) void GuiTable::setSelectedColumn(int selected) { - if (mModel == NULL) + if (!mModel) { mSelectedColumn = -1; } diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp index a92e0dab..24c60caf 100644 --- a/src/gui/truetypefont.cpp +++ b/src/gui/truetypefont.cpp @@ -89,7 +89,7 @@ TrueTypeFont::TrueTypeFont(const std::string& filename, int size) ++fontCounter; mFont = TTF_OpenFont(filename.c_str(), size); - if (mFont == NULL) + if (!mFont) { throw GCN_EXCEPTION("SDLTrueTypeFont::SDLTrueTypeFont: " + std::string(TTF_GetError())); diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 29e7e763..5a6f3f28 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -206,7 +206,7 @@ void UpdaterWindow::loadNews() // Tokenize and add each line separately char *line = strtok(mMemoryBuffer, "\n"); - while (line != NULL) + while (line) { mBrowserBox->addRow(line); line = strtok(NULL, "\n"); @@ -409,7 +409,7 @@ void UpdaterWindow::download() mDownloadComplete = false; mThread = SDL_CreateThread(UpdaterWindow::downloadThread, this); - if (mThread == NULL) + if (!mThread) { logger->log(_("Unable to create mThread")); mDownloadStatus = UPDATE_ERROR; diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index f0d719c6..aaa3463f 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -91,7 +91,7 @@ void TabbedArea::addTab(Tab *tab, gcn::Widget *widget) mTabContainer->add(tab); mTabs.push_back(std::pair(tab, widget)); - if (mSelectedTab == NULL) + if (!mSelectedTab) { setSelectedTab(tab); } diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp index 3378a5d0..b65ff2c9 100644 --- a/src/net/partyhandler.cpp +++ b/src/net/partyhandler.cpp @@ -69,7 +69,7 @@ void PartyHandler::handleMessage(MessageIn *msg) { int id = msg->readInt32(); Being *being = beingManager->findBeing(id); - if (being == NULL) + if (!being) { break; } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index fcd9495f..d6ab39a0 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -160,7 +160,7 @@ void ResourceManager::searchAndAddArchives(const std::string &path, const char *dirSep = PHYSFS_getDirSeparator(); char **list = PHYSFS_enumerateFiles(path.c_str()); - for (char **i = list; *i != NULL; i++) + for (char **i = list; *i; i++) { size_t len = strlen(*i); diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 09e8e0d3..ab50674b 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -51,7 +51,7 @@ SimpleAnimation::SimpleAnimation(xmlNodePtr animationNode): // Get animation frames for ( xmlNodePtr frameNode = animationNode->xmlChildrenNode; - frameNode != NULL; + frameNode; frameNode = frameNode->next) { int delay = XML::getProperty(frameNode, "delay", 0); diff --git a/src/sound.cpp b/src/sound.cpp index 083ffb6a..5b8dedef 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -129,7 +129,7 @@ void Sound::playMusic(const std::string &filename, int loop) { if (!mInstalled) return; - if (mMusic != NULL) { + if (mMusic) { stopMusic(); } @@ -155,7 +155,7 @@ void Sound::stopMusic() logger->log("Sound::stopMusic()"); - if (mMusic != NULL) { + if (mMusic) { Mix_HaltMusic(); Mix_FreeMusic(mMusic); mMusic = NULL; @@ -166,7 +166,7 @@ void Sound::fadeInMusic(const std::string &path, int loop, int ms) { if (!mInstalled) return; - if (mMusic != NULL) { + if (mMusic) { stopMusic(); } @@ -189,7 +189,7 @@ void Sound::fadeOutMusic(int ms) logger->log("Sound::fadeOutMusic() Fading-out (%i ms)", ms); - if (mMusic != NULL) { + if (mMusic) { Mix_FadeOutMusic(ms); Mix_FreeMusic(mMusic); mMusic = NULL; -- cgit v1.2.3-70-g09d2 From 1ea7d80aff0961e6f55ee467b8cbe26d146828f8 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 10 Feb 2009 23:08:35 +0100 Subject: Don't make log statements translatable The log is mainly used to aid the developers, hence shouldn't be translated to the user's local language. Also introduces unnecessary work for all translators. --- po/POTFILES.in | 2 -- src/game.cpp | 10 +++++----- src/gui/register.cpp | 2 +- src/gui/setup_video.cpp | 4 ++-- src/gui/skill.cpp | 2 +- src/gui/updatewindow.cpp | 8 ++++---- src/main.cpp | 42 ++++++++++++++++++++++-------------------- src/net/playerhandler.cpp | 8 ++++---- src/resources/colordb.cpp | 11 +++++------ src/resources/emotedb.cpp | 9 ++++----- src/resources/itemdb.cpp | 16 ++++++++-------- src/resources/monsterdb.cpp | 23 ++++++++++++++--------- src/resources/npcdb.cpp | 6 +++--- 13 files changed, 73 insertions(+), 70 deletions(-) (limited to 'src/net') diff --git a/po/POTFILES.in b/po/POTFILES.in index 1b3dea84..9a2cf604 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -50,8 +50,6 @@ src/net/loginhandler.cpp src/net/maploginhandler.cpp src/net/playerhandler.cpp src/net/tradehandler.cpp -src/resources/colordb.cpp -src/resources/emotedb.cpp src/resources/itemdb.cpp src/resources/monsterdb.cpp src/resources/npcdb.cpp diff --git a/src/game.cpp b/src/game.cpp index 9b11fad2..bc0c86b5 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -389,7 +389,7 @@ static bool saveScreenshot() else { chatWindow->chatLog(_("Saving screenshot failed!"), BY_SERVER); - logger->log(_("Error: could not save screenshot.")); + logger->log("Error: could not save screenshot."); } SDL_FreeSurface(screenshot); @@ -595,9 +595,9 @@ void Game::handleInput() case KeyboardConfig::KEY_QUIT: if (!exitConfirm) { - exitConfirm = new ConfirmDialog( _("Quit"), - _("Are you sure you " - "want to quit?")); + exitConfirm = new ConfirmDialog(_("Quit"), + _("Are you sure you " + "want to quit?")); exitConfirm->addActionListener(&exitListener); exitConfirm->requestMoveToTop(); } @@ -774,7 +774,7 @@ void Game::handleInput() catch (gcn::Exception e) { const char* err = e.getMessage().c_str(); - logger->log(_("Warning: guichan input exception: %s"), err); + logger->log("Warning: guichan input exception: %s", err); } } } // End while diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 50182de1..fd7df18d 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -153,7 +153,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "register" && canSubmit()) { const std::string user = mUserField->getText(); - logger->log(_("RegisterDialog::register Username is %s"), user.c_str()); + logger->log("RegisterDialog::register Username is %s", user.c_str()); std::string errorMsg; int error = 0; diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 48bf63e7..bf5682e6 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -90,9 +90,9 @@ ModeListModel::ModeListModel() /* Check which modes are available */ if (modes == (SDL_Rect **)0) { - logger->log(_("No modes available")); + logger->log("No modes available"); } else if (modes == (SDL_Rect **)-1) { - logger->log(_("All resolutions available")); + logger->log("All resolutions available"); } else { //logger->log("Available Modes"); for (int i = 0; modes[i]; ++i) { diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 6c0414f3..42ac4d86 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -269,7 +269,7 @@ static void initSkillinfo(void) if (!root || !xmlStrEqual(root->name, BAD_CAST "skills")) { - logger->log(_("Error loading skills file: %s"), SKILLS_FILE); + logger->log("Error loading skills file: %s", SKILLS_FILE); skill_db.resize(2, emptySkillInfo); skill_db[1].name = "Basic"; skill_db[1].modifiable = true; diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 5a6f3f28..a25d57d4 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -76,7 +76,7 @@ std::vector loadTextFile(const std::string &fileName) std::ifstream fin(fileName.c_str()); if (!fin) { - logger->log(_("Couldn't load text file: %s"), fileName.c_str()); + logger->log("Couldn't load text file: %s", fileName.c_str()); return lines; } @@ -194,7 +194,7 @@ void UpdaterWindow::loadNews() { if (!mMemoryBuffer) { - logger->log(_("Couldn't load news")); + logger->log("Couldn't load news"); return; } @@ -411,7 +411,7 @@ void UpdaterWindow::download() if (!mThread) { - logger->log(_("Unable to create mThread")); + logger->log("Unable to create mThread"); mDownloadStatus = UPDATE_ERROR; } } @@ -505,7 +505,7 @@ void UpdaterWindow::logic() } else { - logger->log(_("%s already here"), mCurrentFile.c_str()); + logger->log("%s already here", mCurrentFile.c_str()); } mLineIndex++; } diff --git a/src/main.cpp b/src/main.cpp index 80cff8d1..4f66e9da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,14 +208,14 @@ void setUpdatesDir() } else { - logger->log(_("Error: Invalid update host: %s"), updateHost.c_str()); + logger->log("Error: Invalid update host: %s", updateHost.c_str()); errorMessage = _("Invalid update host: ") + updateHost; state = ERROR_STATE; } } else { - logger->log(_("Warning: no protocol was specified for the update host")); + logger->log("Warning: no protocol was specified for the update host"); updates << "updates/" << updateHost << "/" << loginData.port; updatesDir = updates.str(); } @@ -240,14 +240,14 @@ void setUpdatesDir() if (!CreateDirectory(newDir.c_str(), 0) && GetLastError() != ERROR_ALREADY_EXISTS) { - logger->log(_("Error: %s can't be made, but doesn't exist!"), - newDir.c_str()); + logger->log("Error: %s can't be made, but doesn't exist!", + newDir.c_str()); errorMessage = _("Error creating updates directory!"); state = ERROR_STATE; } #else - logger->log(_("Error: %s/%s can't be made, but doesn't exist!"), - homeDir.c_str(), updatesDir.c_str()); + logger->log("Error: %s/%s can't be made, but doesn't exist!", + homeDir.c_str(), updatesDir.c_str()); errorMessage = _("Error creating updates directory!"); state = ERROR_STATE; #endif @@ -286,13 +286,13 @@ void init_engine(const Options &options) logger->setLogFile(homeDir + std::string("/aethyra.log")); #ifdef PACKAGE_VERSION - logger->log(_("Starting Aethyra Version %s"), PACKAGE_VERSION); + logger->log("Starting Aethyra Version %s", PACKAGE_VERSION); #else - logger->log(_("Starting Aethyra - Version not defined")); + logger->log("Starting Aethyra - Version not defined")); #endif // Initialize SDL - logger->log(_("Initializing SDL...")); + logger->log("Initializing SDL..."); if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) { std::cerr << _("Could not initialize SDL: ") << SDL_GetError() << std::endl; @@ -337,7 +337,7 @@ void init_engine(const Options &options) #endif // Fill configuration with defaults - logger->log(_("Initializing configuration...")); + logger->log("Initializing configuration..."); config.setValue("host", "www.aethyra.org"); config.setValue("port", 21001); config.setValue("hwaccel", 0); @@ -451,7 +451,7 @@ void init_engine(const Options &options) catch (const char *err) { state = ERROR_STATE; errorMessage = err; - logger->log(_("Warning: %s"), err); + logger->log("Warning: %s", err); } // Initialize keyboard @@ -497,7 +497,8 @@ void printHelp() << _("Options: ") << std::endl << _(" -C --configfile : Configuration file to use") << std::endl << _(" -d --data : Directory to load game data from") << std::endl - << _(" -D --default : Bypass the login process with default settings") << std::endl + << _(" -D --default : Bypass the login process with default settings") + << std::endl << _(" -h --help : Display this help") << std::endl << _(" -H --updatehost : Use this update host") << std::endl << _(" -p --playername : Login with this player") << std::endl @@ -610,8 +611,8 @@ struct ErrorListener : public gcn::ActionListener // TODO Find some nice place for these functions void accountLogin(Network *network, LoginData *loginData) { - logger->log(_("Trying to connect to account server...")); - logger->log(_("Username is %s"), loginData->username.c_str()); + logger->log("Trying to connect to account server..."); + logger->log("Username is %s", loginData->username.c_str()); network->connect(loginData->hostname, loginData->port); network->registerHandler(&loginHandler); loginHandler.setLoginData(loginData); @@ -665,7 +666,7 @@ void positionDialog(Window *dialog, int screenWidth, int screenHeight) void charLogin(Network *network, LoginData *loginData) { - logger->log(_("Trying to connect to char server...")); + logger->log("Trying to connect to char server..."); network->connect(loginData->hostname, loginData->port); network->registerHandler(&charServerHandler); charServerHandler.setCharInfo(&charInfo); @@ -677,7 +678,8 @@ void charLogin(Network *network, LoginData *loginData) outMsg.writeInt32(loginData->account_ID); outMsg.writeInt32(loginData->session_ID1); outMsg.writeInt32(loginData->session_ID2); - // [Fate] The next word is unused by the old char server, so we squeeze in tmw client version information + // [Fate] The next word is unused by the old char server, so we squeeze in + // tmw client version information outMsg.writeInt16(CLIENT_PROTOCOL_VERSION); outMsg.writeInt8(loginData->sex); @@ -687,14 +689,14 @@ void charLogin(Network *network, LoginData *loginData) void mapLogin(Network *network, LoginData *loginData) { - logger->log(_("Memorizing selected character %s"), + logger->log("Memorizing selected character %s", player_node->getName().c_str()); config.setValue("lastCharacter", player_node->getName()); MessageOut outMsg(network); - logger->log(_("Trying to connect to map server...")); - logger->log(_("Map: %s"), map_path.c_str()); + logger->log("Trying to connect to map server..."); + logger->log("Map: %s", map_path.c_str()); network->connect(loginData->hostname, loginData->port); network->registerHandler(&mapLoginHandler); @@ -824,7 +826,7 @@ int main(int argc, char *argv[]) login_wallpaper = ResourceManager::getInstance()-> getImage(wallpaperName); if (!login_wallpaper) - logger->log(_("Couldn't load %s as wallpaper"), wallpaperName.c_str()); + logger->log("Couldn't load %s as wallpaper", wallpaperName.c_str()); while (state != EXIT_STATE) { diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 21c37ea3..9ca3b48a 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -192,9 +192,9 @@ void PlayerHandler::handleMessage(MessageIn *msg) player_node->mMaxWeight / 2) { weightNotice = new OkDialog(_("Message"), - _("You are carrying more then half " - "your weight. You are unable to " - "regain health.")); + _("You are carrying more then " + "half your weight. You are " + "unable to regain health.")); weightNotice->addActionListener( &weightListener); } @@ -392,7 +392,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) BY_SERVER); break; default: - logger->log(_("0x013b: Unhandled message %i"), type); + logger->log("0x013b: Unhandled message %i", type); break; } } diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 4ff8944c..b53798bb 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -25,7 +25,6 @@ #include "../log.h" -#include "../utils/gettext.h" #include "../utils/xml.h" #define HAIR_COLOR_FILE "colors.xml" @@ -51,7 +50,7 @@ void ColorDB::load() if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log(_("Trying TMW's color file, %s."), TMW_COLOR_FILE); + logger->log("Trying TMW's color file, %s.", TMW_COLOR_FILE); TMWHair = true; @@ -61,7 +60,7 @@ void ColorDB::load() root = doc->rootNode(); if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log(_("ColorDB: Failed")); + logger->log("ColorDB: Failed"); mColors[0] = mFail; mLoaded = true; @@ -78,7 +77,7 @@ void ColorDB::load() if (mColors.find(id) != mColors.end()) { - logger->log(_("ColorDB: Redefinition of dye ID %d"), id); + logger->log("ColorDB: Redefinition of dye ID %d", id); } TMWHair ? mColors[id] = XML::getProperty(node, "value", "#FFFFFF") : @@ -93,7 +92,7 @@ void ColorDB::load() void ColorDB::unload() { - logger->log(_("Unloading color database...")); + logger->log("Unloading color database..."); mColors.clear(); mLoaded = false; @@ -108,7 +107,7 @@ std::string& ColorDB::get(int id) if (i == mColors.end()) { - logger->log(_("ColorDB: Error, unknown dye ID# %d"), id); + logger->log("ColorDB: Error, unknown dye ID# %d", id); return mFail; } else diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index 5a014c95..23a7833c 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.cpp @@ -23,7 +23,6 @@ #include "../log.h" -#include "../utils/gettext.h" #include "../utils/xml.h" namespace @@ -47,14 +46,14 @@ void EmoteDB::load() unknownSprite->variant = 0; mUnknown.sprites.push_back(unknownSprite); - logger->log(_("Initializing emote database...")); + logger->log("Initializing emote database..."); XML::Document doc("emotes.xml"); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "emotes")) { - logger->log(_("Emote Database: Error while loading emotes.xml!")); + logger->log("Emote Database: Error while loading emotes.xml!"); return; } @@ -67,7 +66,7 @@ void EmoteDB::load() int id = XML::getProperty(emoteNode, "id", -1); if (id == -1) { - logger->log(_("Emote Database: Emote with missing ID in emotes.xml!")); + logger->log("Emote Database: Emote with missing ID in emotes.xml!"); continue; } @@ -126,7 +125,7 @@ const EmoteInfo& EmoteDB::get(int id) if (i == mEmoteInfos.end()) { - logger->log(_("EmoteDB: Warning, unknown emote ID %d requested"), id); + logger->log("EmoteDB: Warning, unknown emote ID %d requested", id); return mUnknown; } else diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 5577b5e1..ceaf0395 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -50,7 +50,7 @@ void ItemDB::load() if (mLoaded) return; - logger->log(_("Initializing item database...")); + logger->log("Initializing item database..."); mUnknown = new ItemInfo(); mUnknown->setName(_("Unknown item")); @@ -63,7 +63,7 @@ void ItemDB::load() if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "items")) { - logger->error(_("ItemDB: Error while loading items.xml!")); + logger->error("ItemDB: Error while loading items.xml!"); } for_each_xml_child_node(node, rootNode) @@ -75,12 +75,12 @@ void ItemDB::load() if (id == 0) { - logger->log(_("ItemDB: Invalid or missing item ID in items.xml!")); + logger->log("ItemDB: Invalid or missing item ID in items.xml!"); continue; } else if (mItemInfos.find(id) != mItemInfos.end()) { - logger->log(_("ItemDB: Redefinition of item ID %d"), id); + logger->log("ItemDB: Redefinition of item ID %d", id); } std::string type = XML::getProperty(node, "type", "other"); @@ -136,7 +136,7 @@ void ItemDB::load() } else { - logger->log(_("ItemDB: Duplicate name of item found item %d"), + logger->log("ItemDB: Duplicate name of item found item %d", id); } } @@ -162,7 +162,7 @@ void ItemDB::load() void ItemDB::unload() { - logger->log(_("Unloading item database...")); + logger->log("Unloading item database..."); delete mUnknown; mUnknown = NULL; @@ -180,7 +180,7 @@ const ItemInfo& ItemDB::get(int id) if (i == mItemInfos.end()) { - logger->log(_("ItemDB: Error, unknown item ID# %d"), id); + logger->log("ItemDB: Error, unknown item ID# %d", id); return *mUnknown; } else @@ -236,7 +236,7 @@ void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) } else { - logger->log(_("ItemDB: Ignoring unknown sound event '%s'"), + logger->log("ItemDB: Ignoring unknown sound event '%s'", event.c_str()); } } diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 13f3a7ee..b1965989 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -44,14 +44,14 @@ void MonsterDB::load() mUnknown.addSprite("error.xml"); mUnknown.setName(_("unnamed")); - logger->log(_("Initializing monster database...")); + logger->log("Initializing monster database..."); XML::Document doc(_("monsters.xml")); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters")) { - logger->error(_("Monster Database: Error while loading monster.xml!")); + logger->error("Monster Database: Error while loading monster.xml!"); } //iterate s @@ -64,7 +64,7 @@ void MonsterDB::load() MonsterInfo *currentInfo = new MonsterInfo(); - currentInfo->setName (XML::getProperty(monsterNode, "name", "unnamed")); + currentInfo->setName(XML::getProperty(monsterNode, "name", _("unnamed"))); std::string targetCursor; targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium"); @@ -82,7 +82,8 @@ void MonsterDB::load() } else { - logger->log(_("MonsterDB: Unknown target cursor type \"%s\" for %s - using medium sized one"), + logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s -" + "using medium sized one", targetCursor.c_str(), currentInfo->getName().c_str()); currentInfo->setTargetCursorSize(Being::TC_MEDIUM); } @@ -92,7 +93,8 @@ void MonsterDB::load() { if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { - currentInfo->addSprite((const char*) spriteNode->xmlChildrenNode->content); + currentInfo->addSprite( + (const char*) spriteNode->xmlChildrenNode->content); } if (xmlStrEqual(spriteNode->name, BAD_CAST "sound")) @@ -119,14 +121,17 @@ void MonsterDB::load() } else { - logger->log(_("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s"), - filename, event.c_str(), currentInfo->getName().c_str()); + logger->log("MonsterDB: Warning, sound effect %s for " + "unknown event %s of monster %s", + filename, event.c_str(), + currentInfo->getName().c_str()); } } if (xmlStrEqual(spriteNode->name, BAD_CAST "attack")) { - std::string event = XML::getProperty(spriteNode, "particle-effect", ""); + std::string event = XML::getProperty( + spriteNode, "particle-effect", ""); currentInfo->addAttackParticleEffect(event); } @@ -157,7 +162,7 @@ const MonsterInfo &MonsterDB::get(int id) if (i == mMonsterInfos.end()) { - logger->log(_("MonsterDB: Warning, unknown monster ID %d requested"), id); + logger->log("MonsterDB: Warning, unknown monster ID %d requested", id); return mUnknown; } else diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 177d3116..3e9decf1 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -44,7 +44,7 @@ void NPCDB::load() unknownSprite->variant = 0; mUnknown.sprites.push_back(unknownSprite); - logger->log(_("Initializing NPC database...")); + logger->log("Initializing NPC database..."); XML::Document doc("npcs.xml"); xmlNodePtr rootNode = doc.rootNode(); @@ -63,7 +63,7 @@ void NPCDB::load() int id = XML::getProperty(npcNode, "id", 0); if (id == 0) { - logger->log(_("NPC Database: NPC with missing ID in npcs.xml!")); + logger->log("NPC Database: NPC with missing ID in npcs.xml!"); continue; } @@ -121,7 +121,7 @@ const NPCInfo& NPCDB::get(int id) if (i == mNPCInfos.end()) { - logger->log(_("NPCDB: Warning, unknown NPC ID %d requested"), id); + logger->log("NPCDB: Warning, unknown NPC ID %d requested", id); return mUnknown; } else -- cgit v1.2.3-70-g09d2 From 93eb477c5f6ab3d111bf26138708f5917c3c9f3d Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Wed, 11 Feb 2009 12:16:04 -0700 Subject: Removed a few unneeded includes in the being handler. Signed-off-by: Ira Rice --- src/net/beinghandler.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/net') diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 15a659b3..c11d22e7 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -34,9 +34,7 @@ #include "../localplayer.h" #include "../log.h" #include "../npc.h" -#include "../particle.h" #include "../player_relations.h" -#include "../sound.h" const int EMOTION_TIME = 150; /**< Duration of emotion icon */ -- cgit v1.2.3-70-g09d2 From 8c2aab9351dd0483637921883d13669dd2489e1a Mon Sep 17 00:00:00 2001 From: Kess Vargavind Date: Thu, 12 Feb 2009 08:48:11 +0100 Subject: Fix some spelling and whitespace Also a few whitespace and spelling fixes. --- src/net/loginhandler.cpp | 12 +++++------ src/net/playerhandler.cpp | 54 ++++++++++++++++++++++++++++++----------------- 2 files changed, 41 insertions(+), 25 deletions(-) (limited to 'src/net') diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 34da5c6d..e173252f 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -81,7 +81,7 @@ void LoginHandler::handleMessage(MessageIn *msg) mUpdateHost = msg->readString(len); logger->log("Received update host \"%s\" from login server", - mUpdateHost.c_str()); + mUpdateHost.c_str()); break; case 0x0069: @@ -136,14 +136,14 @@ void LoginHandler::handleMessage(MessageIn *msg) break; case 4: - errorMessage = _("You have been permanently banned from the" - " game. Please contact the GM Team"); + errorMessage = _("You have been permanently banned from " + "the game. Please contact the GM Team."); break; case 6: errorMessage = strprintf(_("You have been temporarily " - "banned from the game until %s.\n" - " Please contact the GM team via " - "the forums"), + "banned from the game until " + "%s.\n Please contact the GM " + "team via the forums."), msg->readString(20).c_str()); break; case 9: diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 9ca3b48a..9c34cec6 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -52,8 +52,9 @@ extern BuyDialog *buyDialog; extern SellDialog *sellDialog; extern Window *buySellDialog; -static const int MAP_TELEPORT_SCROLL_DISTANCE = 8; /* Max. distance we are willing to scroll after a teleport; - * everything beyond will reset the port hard. */ +// Max. distance we are willing to scroll after a teleport; +// everything beyond will reset the port hard. +static const int MAP_TELEPORT_SCROLL_DISTANCE = 8; /** * Listener used for handling the overweigth message. @@ -158,7 +159,9 @@ void PlayerHandler::handleMessage(MessageIn *msg) player_node->mX = x; player_node->mY = y; - logger->log("Adjust scrolling by %d:%d", (int)scrollOffsetX, (int)scrollOffsetY); + logger->log("Adjust scrolling by %d:%d", + (int)scrollOffsetX, + (int)scrollOffsetY); viewport->scrollBy(scrollOffsetX, scrollOffsetY); } @@ -192,7 +195,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) player_node->mMaxWeight / 2) { weightNotice = new OkDialog(_("Message"), - _("You are carrying more then " + _("You are carrying more than " "half your weight. You are " "unable to regain health.")); weightNotice->addActionListener( @@ -212,37 +215,50 @@ void PlayerHandler::handleMessage(MessageIn *msg) case 0x0037: player_node->mJobLevel = value; break; } - if (player_node->mHp == 0 && deathNotice == NULL) + if (player_node->mHp == 0 && !deathNotice) { static char const *const deadMsg[] = { _("You are dead."), - _("We regret to inform you that your character was killed in battle."), + _("We regret to inform you that your character was " + "killed in battle."), _("You are not that alive anymore."), - _("The cold hands of the grim reaper are grabbing for your soul."), + _("The cold hands of the grim reaper are grabbing for " + "your soul."), _("Game Over!"), _("Insert coin to continue"), - _("No, kids. Your character did not really die. It... err... went to a better place."), - _("Your plan of breaking your enemies weapon by bashing it with your throat failed."), + _("No, kids. Your character did not really die. It... " + "err... went to a better place."), + _("Your plan of breaking your enemies weapon by " + "bashing it with your throat failed."), _("I guess this did not run too well."), - _("Do you want your possessions identified?"), // Nethack reference - _("Sadly, no trace of you was ever found..."), // Secret of Mana reference - _("Annihilated."), // Final Fantasy VI reference - _("Looks like you got your head handed to you."), //Earthbound reference - _("You screwed up again, dump your body down the tubes and get you another one."), // Leisure Suit Larry 1 Reference - _("You're not dead yet. You're just resting."), // Monty Python reference from a couple of skits - _("You are no more."), // Monty Python reference from the dead parrot sketch starting now + // NetHack reference: + _("Do you want your possessions identified?"), + // Secret of Mana reference: + _("Sadly, no trace of you was ever found..."), + // Final Fantasy VI reference: + _("Annihilated."), + // Earthbound reference: + _("Looks like you got your head handed to you."), + // Leisure Suit Larry 1 reference: + _("You screwed up again, dump your body down the tubes " + "and get you another one."), + // Monty Python references (Dead Parrot sketch mostly): + _("You're not dead yet. You're just resting."), + _("You are no more."), _("You have ceased to be."), _("You've expired and gone to meet your maker."), _("You're a stiff."), _("Bereft of life, you rest in peace."), - _("If you weren't so animated, you'd be pushing up the daisies."), + _("If you weren't so animated, you'd be pushing up the " + "daisies."), _("Your metabolic processes are now history."), _("You're off the twig."), _("You've kicked the bucket."), - _("You've shuffled off your mortal coil, run down the curtain and joined the bleedin' choir invisibile."), + _("You've shuffled off your mortal coil, run down the " + "curtain and joined the bleedin' choir invisibile."), _("You are an ex-player."), - _("You're pining for the fjords.") // Monty Python reference from the dead parrot sketch + _("You're pining for the fjords.") }; std::string message(deadMsg[rand()%27]); -- cgit v1.2.3-70-g09d2