Pastebin - Nopaste - Paste - easy sharing of text and codes

Difference between
modified post 2384 by blue_anna on Sat 4th Sep 02:48 and
original post 2383 by blue_anna on Sat 4th Sep 02:14
Show old version | new version | both versions

    
1-
				  const monsters cmon = agent->as_monster();
1+
			  else
2-
				  monsters* mon = &cmon;
2+
			  {
3-
				  agent->as_monster()->hurt(this, initial_damage, flavour, cleanup_dead);
3+
				  const monsters* cmon = agent->as_monster();
4+
				  monsters* mon = const_cast<monsters*>(cmon);
5+
				  mon->hurt(this, initial_damage, flavour, cleanup_dead);
6+
			  }
5-
    DEPEND monster.d
6-
    CXX monster.o
7-
monster.cc: In member function ‘virtual int monsters::hurt(const actor*, int, beam_type, bool)’:
8-
monster.cc:3488: error: conversion from ‘const monsters*’ to non-scalar type ‘const monsters’ requested
9-
monster.cc:3489: error: invalid conversion from ‘const monsters*’ to ‘monsters*’
10-
monster.cc:3490: error: passing ‘const monsters’ as ‘this’ argument of ‘virtual int monsters::hurt(const actor*, int, beam_type, bool)’ discards qualifiers
11-
monster.cc:3489: warning: unused variable ‘mon’
12-
make: *** [monster.o] Error 1

Syntax highlighting:

To highlight particular lines, prefix each line with @@


I'm Human
Remember me



Captcha required for posting