View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001084 | The Dark Mod | Coding | public | 04.09.2008 22:24 | 01.02.2021 14:13 |
Reporter | SneaksieDave | Assigned To | tels | ||
Priority | normal | Severity | normal | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | SVN | ||||
Target Version | TDM 2.09 | Fixed in Version | TDM 2.09 | ||
Summary | 0001084: Grabber doesn't allow frobbing after held item is removed | ||||
Description | See discussion starting here for details: https://forums.thedarkmod.com/index.php?/topic/8208-scripting-how-to-discussions/&tab=comments#comment-162092 In short, after a held junk item is remove()'d, frobbing to carry another item (perhaps any frobbing...) no longer functions. It must be IN the hand when this remove() occurs (if I throw the knife instead into the remove() field, I can still frob). | ||||
Tags | No tags attached. | ||||
This might be fixed by 2993 and 5302 | |
Now I have replication steps: 1) Start a small map such as Closemouthed Shadows 2) Open the console and invoke "spawn atdm:moveable_kitchen_knife_chef" 3) Identify the knife via g_showEntityInfo ( Should be idMoveable_atdm:moveable_kitchen_knife_chef_149 ) 4) Pickup the knife 5) Open the console and invoke "remove idMoveable_atdm:moveable_kitchen_knife_chef_149" 6) Try to frob any other object Not yet fixed... |
|
Class.cpp > Event_Remove (Current code) CGrabber* grabber = gameLocal.m_Grabber; if (grabber) { // tels: If we remove a currently grabbed entity, // force the grabber to forget it idEntity *ent = grabber->GetSelected(); if (ent == this) { grabber->Forget( ent ); } } |
|
game/gamesys/SysCmds > Cmd_Remove_f does not have this grabber check | |
Rev 9094 (2.09 beta) I suspect that this was fixed for scripts long ago. Now the console command is also fixed. |
|
Originally fixed by Tels in Rev 2974 | |
Hey, nbohr1more, what's the point of rev 9094? I would hardly call it "a fix", since it only affects console command. The script code can call simple "remove" to kill entity directly, in which case your fix won't work. Hot-reload can also remove entity directly without "remove" command. If the problem is still here, it must be fixed in idEntity destructor. This is the code which is surely called in all the possible cases. |
|
To my understanding, the script will call the Event_Remove which has the fix that Tels provided. My change simply allows a mapper to remove a held entity via the console without unexpectedly finding that they can no longer frob things. It is much less important. If there are other cases where this can happen we should harden them too. I expect we would apply a similar fix to the "bad readable xdata causes grabber to break" issue. |
|
Wouldn't it better to move Tels's fix to the destructor of idEntity? There is already some other code (thee pieces now, all in different places) which checks if the removed entity is used by grabber. UPDATE: by the way, now mappers use hot reload, and will soon complain about the same when they remove entity in DR. |
|
Yes, it would be better to move all these to the destructor "idEntity::~idEntity". |
|
Alright this block needs to be rearranged for a purely held entity: if (gameLocal.m_Grabber && gameLocal.m_Grabber->GetEquipped() == this) { if ( spawnArgs.GetBool("shoulderable") ) { gameLocal.Printf("Grabber: Forcefully unshouldering %s because it will be removed.\n", GetName() ); gameLocal.m_Grabber->UnShoulderBody(this); } gameLocal.Printf("Grabber: Forcefully dequipping %s because it will be removed.\n", GetName() ); gameLocal.m_Grabber->Forget(this); } |
|
Here is the revised block: if (gameLocal.m_Grabber ) { if ( gameLocal.m_Grabber->GetEquipped() == this ) { if ( spawnArgs.GetBool("shoulderable") ) { gameLocal.Printf("Grabber: Forcefully unshouldering %s because it will be removed.\n", GetName() ); gameLocal.m_Grabber->UnShoulderBody(this); } gameLocal.Printf("Grabber: Forcefully dequipping %s because it will be removed.\n", GetName() ); gameLocal.m_Grabber->Forget(this); } else if ( gameLocal.m_Grabber->GetSelected() == this ) { gameLocal.m_Grabber->Forget(this); } } Rev 9097 |
|
Yes, this is much better. Thanks! By the way, could you please look why your editor does not support editorconfig? The lines you added have spaces instead of tabs. Normally, this should not happen for decent editors, because of .editorconfig rules. |
|
Committed minor cleanup in svn rev 9099. | |
Date Modified | Username | Field | Change |
---|---|---|---|
04.09.2008 22:24 | SneaksieDave | New Issue | |
15.05.2020 03:21 | nbohr1more | Description Updated | |
29.01.2021 04:40 | nbohr1more | Relationship added | related to 0005302 |
29.01.2021 04:44 | nbohr1more | Note Added: 0013562 | |
29.01.2021 04:44 | nbohr1more | Status | new => feedback |
29.01.2021 04:44 | nbohr1more | Target Version | => TDM 2.09 |
30.01.2021 12:41 | nbohr1more | Note Added: 0013580 | |
30.01.2021 12:42 | nbohr1more | Status | feedback => confirmed |
30.01.2021 12:57 | nbohr1more | Note Added: 0013581 | |
30.01.2021 17:18 | nbohr1more | Note Added: 0013583 | |
30.01.2021 17:41 | nbohr1more | Note Added: 0013584 | |
30.01.2021 17:42 | nbohr1more | Status | confirmed => resolved |
30.01.2021 17:42 | nbohr1more | Resolution | open => fixed |
30.01.2021 17:42 | nbohr1more | Fixed in Version | => TDM 2.09 |
30.01.2021 21:25 | nbohr1more | Note Added: 0013585 | |
30.01.2021 21:27 | nbohr1more | Assigned To | => tels |
30.01.2021 21:27 | nbohr1more | Fixed in Version | TDM 2.09 => TDM 1.00 |
30.01.2021 21:27 | nbohr1more | Target Version | TDM 2.09 => |
30.01.2021 21:32 | nbohr1more | Note Edited: 0013584 | |
31.01.2021 16:16 | stgatilov | Note Added: 0013589 | |
31.01.2021 16:47 | nbohr1more | Note Added: 0013590 | |
31.01.2021 16:51 | stgatilov | Note Added: 0013591 | |
31.01.2021 16:52 | stgatilov | Note Edited: 0013591 | |
31.01.2021 17:04 | nbohr1more | Note Added: 0013592 | |
31.01.2021 17:12 | nbohr1more | Note Edited: 0013592 | |
31.01.2021 17:18 | nbohr1more | Note Edited: 0013592 | |
31.01.2021 17:31 | nbohr1more | Note Added: 0013593 | |
31.01.2021 23:55 | nbohr1more | Note Added: 0013595 | |
01.02.2021 00:07 | nbohr1more | Note Edited: 0013595 | |
01.02.2021 13:45 | stgatilov | Note Added: 0013599 | |
01.02.2021 13:58 | stgatilov | Note Added: 0013601 | |
01.02.2021 14:13 | nbohr1more | Fixed in Version | TDM 1.00 => TDM 2.09 |
01.02.2021 14:13 | nbohr1more | Target Version | => TDM 2.09 |