10-26-2011, 11:32 PM
No worries, I added the files to the project now
I made some changes to your monster spawning code (I just cleaned it up), you can see the changes here:
http://code.google.com/p/mc-server/sourc...cWorld.cpp
All monsters are derived from cMonster, so you don't need a special variable for each monster type, just one single cMonster pointer. You also always call three functions on the monster after creating it, you do that for each monster type. If you simply take those three functions out of the if statements, you will keep the code clean and readable, plus you have to write less code
I made some changes to your monster spawning code (I just cleaned it up), you can see the changes here:
http://code.google.com/p/mc-server/sourc...cWorld.cpp
All monsters are derived from cMonster, so you don't need a special variable for each monster type, just one single cMonster pointer. You also always call three functions on the monster after creating it, you do that for each monster type. If you simply take those three functions out of the if statements, you will keep the code clean and readable, plus you have to write less code