diff options
author | Steven Noonan <steven@uplinklabs.net> | 2009-12-12 16:11:59 -0800 |
---|---|---|
committer | Steven Noonan <steven@uplinklabs.net> | 2009-12-12 16:11:59 -0800 |
commit | e86c5d67d5ee5d0a73d74eea90d25fa84cce2ca3 (patch) | |
tree | 9fb3dd4d33e05a73af08224b20242bbfe86bce74 /crawl-ref/source | |
parent | 14bfaca7e0b40811a7e7a3bb5ebe1ac952dbbbb7 (diff) | |
download | crawl-ref-e86c5d67d5ee5d0a73d74eea90d25fa84cce2ca3.tar.gz crawl-ref-e86c5d67d5ee5d0a73d74eea90d25fa84cce2ca3.zip |
player.{cc,h}: fix copy constructor for dolls_data struct
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/player.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index cc1b2f1fd7..0e5935cc9e 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -80,6 +80,12 @@ dolls_data::dolls_data() memset(parts, 0, TILEP_PART_MAX * sizeof(int)); } +dolls_data::dolls_data(dolls_data const &_orig) +{ + parts = new int[TILEP_PART_MAX]; + memcpy(parts, _orig.parts, TILEP_PART_MAX * sizeof(int)); +} + dolls_data::~dolls_data() { delete [] parts; diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 78c867b272..972b648b65 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -18,6 +18,7 @@ struct dolls_data { dolls_data(); + dolls_data(dolls_data const &); ~dolls_data(); int *parts; |