Small fixes

develop
Petr Mrázek 2010-11-03 10:45:29 +01:00
parent cb6cf89b0c
commit 457b331be7
4 changed files with 22 additions and 16 deletions

@ -1,10 +1,6 @@
#ifndef CL_MOD_ITEMS #ifndef CL_MOD_ITEMS
#define CL_MOD_ITEMS #define CL_MOD_ITEMS
/*
* DEPRECATED, DO NOT USE UNTIL FURTHER NOTICE!
**/
/* /*
* Creatures * Creatures
*/ */

@ -262,8 +262,17 @@ Items::Items(DFContextShared * d_)
d->d = d_; d->d = d_;
d->owner = d_->p; d->owner = d_->p;
} }
bool Items::Start(){return true;}
bool Items::Finish(){return true;} bool Items::Start()
{
return true;
}
bool Items::Finish()
{
return true;
}
Items::~Items() Items::~Items()
{ {
Finish(); Finish();
@ -285,10 +294,10 @@ bool Items::getItemData(uint32_t itemptr, DFHack::t_item &item)
Process * p = d->owner; Process * p = d->owner;
ItemDesc * desc; ItemDesc * desc;
it = d->descVTable.find(itemptr);
if(it==d->descVTable.end())
{
uint32_t vtable = p->readDWord(itemptr); uint32_t vtable = p->readDWord(itemptr);
it = d->descVTable.find(vtable);
if(it == d->descVTable.end())
{
desc = new ItemDesc(vtable, p); desc = new ItemDesc(vtable, p);
d->descVTable[vtable] = desc; d->descVTable[vtable] = desc;
d->descType[desc->mainType] = desc; d->descType[desc->mainType] = desc;
@ -305,7 +314,7 @@ std::string Items::getItemClass(int32_t index)
std::string out; std::string out;
it = d->descType.find(index); it = d->descType.find(index);
if(it==d->descType.end()) if(it == d->descType.end())
{ {
/* these are dummy values for mood decoding */ /* these are dummy values for mood decoding */
switch(index) switch(index)

@ -2,6 +2,12 @@
* dumps vtables, items types and class name for all items in game * dumps vtables, items types and class name for all items in game
* best used this way : ./dfitemdump | sort -ug * best used this way : ./dfitemdump | sort -ug
*/ */
// THIS IS NOT A GOOD EXAMPLE!
// ... just look at all the magic numbers.
// I'm not fixing it though.
// ~px
#include <stdio.h> #include <stdio.h>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>

@ -16,12 +16,7 @@ using namespace std;
class Point class Point
{ {
public: public:
Point(uint32_t x, uint32_t y, uint32_t z) Point(uint32_t _x, uint32_t _y, uint32_t _z):x(_x),y(_y),z(_z) {}
{
this->x = x;
this->y = y;
this->z = z;
}
Point() Point()
{ {
x = y = z = 0; x = y = z = 0;