diff options
author | Neil Moore <neil@s-z.org> | 2013-10-16 22:03:46 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-10-16 22:03:46 -0400 |
commit | 085050246da27761d57e12145f850233203a4ae5 (patch) | |
tree | a21ca8294580f4274492c2c9f1cc2b93ba28fdaa /crawl-ref/source/los_def.cc | |
parent | 6aec31b66f9085e9666c637a04d7d7dc817d4ebf (diff) | |
download | crawl-ref-085050246da27761d57e12145f850233203a4ae5.tar.gz crawl-ref-085050246da27761d57e12145f850233203a4ae5.zip |
Fix some assignment operators.
These three did not properly handle self-assignment.
Diffstat (limited to 'crawl-ref/source/los_def.cc')
-rw-r--r-- | crawl-ref/source/los_def.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/los_def.cc b/crawl-ref/source/los_def.cc index 1a20e9753d..5b881b8995 100644 --- a/crawl-ref/source/los_def.cc +++ b/crawl-ref/source/los_def.cc @@ -29,8 +29,11 @@ los_def::los_def(const los_def& los) los_def& los_def::operator=(const los_def& los) { - init(los.center, *los.opc, los.bds); - show = los.show; + if (this != &los) + { + init(los.center, *los.opc, los.bds); + show = los.show; + } return *this; } |