Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Language Reference and Guide
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#18
RE: Script Language Reference and Guide

Oh, BTW, it just occured to me that you misunderstood what the problem is about.
It can't be const because it is possible to change the string via a reference. That's not the problem.
(01-29-2013, 11:18 AM)Thomas Wrote: I think the problem is simply that the return value could be
const string&, otherwise it is possible to change the value and you get all kinds of strange stuff.
Exactly - 'all kinds of stuff' happening is exactly how things are now, in the shipped game - it works a few times (value gets changed through a ref), but then the memory gets corrupt or something. That's what I'm trying to warn you about.

I know that this is not how the function was meant to be used, but as long as it is possible, there's a chance someone will do it - and by providing custom story/mod support, you are releasing an API of sorts to the public, so considering this sort of things becomes important.
01-29-2013, 01:18 PM
Find


Messages In This Thread
RE: Script Language Reference and Guide - by TheGreatCthulhu - 01-29-2013, 01:18 PM



Users browsing this thread: 1 Guest(s)