|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: EvilSOB]
#259921
04/08/09 08:28
04/08/09 08:28
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
Hey garv, my last post does contain a function to use as a workaround, if you are deperate. Oh yeah, missed it, because I read the post before the edit. This might be a very slow function if you got many entities. And I do. But I feel we need to band together and try to get a real fix for this pushed through as an engine update. I agree! This is a very inappropriate limitation that has to be fixed. So jcl - accept our request please 
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259943
04/08/09 10:11
04/08/09 10:11
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Ive added THIS request, and a link back here, to "The Future" forum.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: EvilSOB]
#260089
04/08/09 20:49
04/08/09 20:49
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
Great! The solution offered by jcl would be perfect!
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: EvilSOB]
#260139
04/09/09 04:48
04/09/09 04:48
|
Joined: Mar 2009
Posts: 112 Germany
KDuke
Member
|
Member
Joined: Mar 2009
Posts: 112
Germany
|
Well as the parameter is a newly created variable which isn't changed if the entity gets removed it should be possible to do the following:
function doSomeStuff(ENTITY** ent){
while(*ent){
// do something as logn as the entity exists
wait(1);
}
// do something else -> this is not performed!!!
}
Then you gotta call the function this way: This way you are not creating a copy of the entity-pointer but rather more you access the memory where the entity-pointer is stored and it will be changed if the entity gets removed. greetings K-Duke
Using A7 Free Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: KDuke]
#260141
04/09/09 05:07
04/09/09 05:07
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Ive got a sneaky suspison it will fail as soon as doSomeStuff hits its first wait. I have recently discovered, with JCL's help, that the "&" operator WILL fail if (in your example) TestBlock is a local pointer. (due to multitasking of pointers) Also, there is no way you could test if the ME, MY, or YOU pointers have a valid entry. Also, for it to work, when you ent_remove(TestBlock); you also have to follow with TestBlock=NULL;
Nice try though, but Ive already been down that road.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: EvilSOB]
#260143
04/09/09 05:41
04/09/09 05:41
|
Joined: Mar 2009
Posts: 112 Germany
KDuke
Member
|
Member
Joined: Mar 2009
Posts: 112
Germany
|
*deleted* has been nonsense!
Last edited by KDuke; 04/09/09 05:43.
Using A7 Free Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: KDuke]
#260146
04/09/09 06:11
04/09/09 06:11
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Eh? I dont follow? Am I wrong? It DOES happen. I have had faulty test processes before that led me to being stupid.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: delinkx]
#260156
04/09/09 07:00
04/09/09 07:00
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Dunno what was deleted, but Ive tried you suggestion, but still no luck. Tried it by feeding it doSomeStuff(&Globally_defined_TestBlock);
and
doSomeStuff(&Locally_defined_TestBlock);
and
me=TestBlock; doSomeStuff(&me); All of which failed, in varying severity crashes. None with usable error messages at crash. Sorry.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|