Update of /cvsroot/wpdev/wolfpack/ai
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12336/ai
Modified Files:
ai.h ai_animals.cpp ai_humans.cpp ai_monsters.cpp
Log Message:
Fixed bug #0000348 ( Guards should kill instantly )
Index: ai_animals.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai/ai_animals.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** ai_animals.cpp 1 Oct 2004 22:30:43 -0000 1.16
--- ai_animals.cpp 9 Oct 2004 14:32:21 -0000 1.17
***************
*** 38,60 ****
#include <math.h>
- static AbstractAI* productCreator_AW()
- {
- return new Animal_Wild( NULL );
- }
-
void Animal_Wild::registerInFactory()
{
! AIFactory::instance()->registerType( "Animal_Wild", productCreator_AW );
! AIFactory::instance()->registerType( "Animal_Aggressive", productCreator_AW );
! }
!
! static AbstractAI* productCreator_AD()
! {
! return new Animal_Domestic( NULL );
}
void Animal_Domestic::registerInFactory()
{
! AIFactory::instance()->registerType( "Animal_Domestic", productCreator_AD );
}
--- 38,50 ----
#include <math.h>
void Animal_Wild::registerInFactory()
{
! AIFactory::instance()->registerType( "Animal_Wild", productCreatorFunctor<Animal_Wild> );
! AIFactory::instance()->registerType( "Animal_Aggressive", productCreatorFunctor<Animal_Wild> );
}
void Animal_Domestic::registerInFactory()
{
! AIFactory::instance()->registerType( "Animal_Domestic", productCreatorFunctor<Animal_Domestic> );
}
Index: ai_humans.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai/ai_humans.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** ai_humans.cpp 3 Oct 2004 13:51:40 -0000 1.23
--- ai_humans.cpp 9 Oct 2004 14:32:21 -0000 1.24
***************
*** 45,56 ****
#include <math.h>
- static AbstractAI* productCreator_HV()
- {
- return new Human_Vendor( 0 );
- }
-
void Human_Vendor::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Vendor", productCreator_HV );
}
--- 45,51 ----
#include <math.h>
void Human_Vendor::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Vendor", productCreatorFunctor<Human_Vendor> );
}
***************
*** 85,96 ****
}
- static AbstractAI* productCreator_HS()
- {
- return new Human_Stablemaster( NULL );
- }
-
void Human_Stablemaster::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Stablemaster", productCreator_HS );
}
--- 80,86 ----
}
void Human_Stablemaster::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Stablemaster", productCreatorFunctor<Human_Stablemaster> );
}
***************
*** 225,236 ****
}
- static AbstractAI* productCreator_HGC()
- {
- return new Human_Guard_Called( NULL );
- }
-
void Human_Guard_Called::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Guard_Called", productCreator_HGC );
}
--- 215,221 ----
}
void Human_Guard_Called::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Guard_Called", productCreatorFunctor<Human_Guard_Called> );
}
***************
*** 299,302 ****
--- 284,288 ----
m_npc->resend( false );
+ pTarget->kill( m_npc );
}
}
***************
*** 338,349 ****
}
- static AbstractAI* productCreator_HG()
- {
- return new Human_Guard( NULL );
- }
-
void Human_Guard::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Guard", productCreator_HG );
}
--- 324,330 ----
}
void Human_Guard::registerInFactory()
{
! AIFactory::instance()->registerType( "Human_Guard", productCreatorFunctor<Human_Guard> );
}
***************
*** 439,442 ****
--- 420,425 ----
case 1:
m_npc->talk( tr( "Death to all Evil!" ), 0xFFFF, 0, true ); break;
+ default:
+ break;
}
}
Index: ai.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai/ai.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ai.h 3 Oct 2004 13:51:40 -0000 1.17
--- ai.h 9 Oct 2004 14:32:21 -0000 1.18
***************
*** 825,827 ****
--- 825,833 ----
};
+ template< typename T >
+ AbstractAI* productCreatorFunctor()
+ {
+ return new T(0);
+ }
+
#endif /* AI_H_HEADER_INCLUDED */
Index: ai_monsters.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai/ai_monsters.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** ai_monsters.cpp 20 Sep 2004 02:37:58 -0000 1.24
--- ai_monsters.cpp 9 Oct 2004 14:32:21 -0000 1.25
***************
*** 158,169 ****
}
- static AbstractAI* productCreator_MAL0()
- {
- return new Monster_Aggressive_L0( NULL );
- }
-
void Monster_Aggressive_L0::registerInFactory()
{
! AIFactory::instance()->registerType( "Monster_Aggressive_L0", productCreator_MAL0 );
}
--- 158,164 ----
}
void Monster_Aggressive_L0::registerInFactory()
{
! AIFactory::instance()->registerType( "Monster_Aggressive_L0", productCreatorFunctor<Monster_Aggressive_L0> );
}
***************
*** 172,183 ****
}
- static AbstractAI* productCreator_MB()
- {
- return new Monster_Berserk( NULL );
- }
-
void Monster_Berserk::registerInFactory()
{
! AIFactory::instance()->registerType( "Monster_Berserk", productCreator_MB );
}
--- 167,173 ----
}
void Monster_Berserk::registerInFactory()
{
! AIFactory::instance()->registerType( "Monster_Berserk", productCreatorFunctor<Monster_Berserk> );
}
***************
*** 186,197 ****
}
- static AbstractAI* productCreator_MAL1()
- {
- return new Monster_Aggressive_L1( NULL );
- }
-
void Monster_Aggressive_L1::registerInFactory()
{
! AIFactory::instance()->registerType( "Monster_Aggressive_L1", productCreator_MAL1 );
}
--- 176,182 ----
}
void Monster_Aggressive_L1::registerInFactory()
{
! AIFactory::instance()->registerType( "Monster_Aggressive_L1", productCreatorFunctor<Monster_Aggressive_L1> );
}
|