12-26-2011, 08:52 AM
Ohh
I found something big for refactoring
The mobsystem was very C & P ´ed
http://code.google.com/p/mc-server/source/detail?r=112
Removed bPassiveAggressive
Replaced by cPassiveAggressiveMonster Parentclass
state Aggressive is replaced by AggressiveMonster
and state Passive is replaced by PassiveMonster
This makes it much for easy to add new states because not every behavior is hardcoded in the cMonster class
The cause for looking at it was a bug which caused mobs to follow player in creative mode.
I would had to implement this code for every partially aggressive mob. Now I only had to change the AggressiveMob class
I found something big for refactoring
The mobsystem was very C & P ´ed
http://code.google.com/p/mc-server/source/detail?r=112
Removed bPassiveAggressive
Replaced by cPassiveAggressiveMonster Parentclass
state Aggressive is replaced by AggressiveMonster
and state Passive is replaced by PassiveMonster
This makes it much for easy to add new states because not every behavior is hardcoded in the cMonster class
The cause for looking at it was a bug which caused mobs to follow player in creative mode.
I would had to implement this code for every partially aggressive mob. Now I only had to change the AggressiveMob class